-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (36 loc) · 816 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CC ?= gcc
PYTHON ?= python
PREFIX ?= /usr/local
INCLUDEDIR ?= include
LIBDIR ?= lib
BINDIR ?= bin
CFLAGS = -g -Wall -pedantic
ENABLE_TIMER ?= no
ifeq '$(ENABLE_TIMER)' 'yes'
CFLAGS += -DCU_ENABLE_TIMER
endif
TARGETS = libcu.a
all: $(TARGETS)
libcu.a: cu.o
ar cr $@ $^
ranlib $@
cu.o: cu.c cu.h
$(CC) $(CFLAGS) -c -o $@ $<
install: libcu.a
mkdir -p $(PREFIX)/$(INCLUDEDIR)
mkdir -p $(PREFIX)/$(LIBDIR)
mkdir -p $(PREFIX)/$(BINDIR)
cp cu.h $(PREFIX)/$(INCLUDEDIR)/
cp libcu.a $(PREFIX)/$(LIBDIR)/
cp cu-check-regressions $(PREFIX)/$(BINDIR)/
deb:
$(PYTHON) debian/make-changelog.py <CHANGELOG >debian/changelog
cp BSD-LICENSE debian/copyright
debuild -us -uc
clean:
rm -f *.o
rm -f $(TARGETS)
$(MAKE) -C testsuites clean
check:
$(MAKE) -C testsuites
.PHONY: all clean check