-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (41 loc) · 1.06 KB
/
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
51
52
53
54
CC = gcc
CCLD = gcc
AR = gcc-ar
CFLAGS = -pipe -O3 -D_FORTIFY_SOURCE=2 \
-Wall -Werror=implicit-function-declaration -Werror=format-security \
-Werror=return-type -Werror=int-conversion -Werror=strict-prototypes \
-Wstrict-aliasing=3
LDFLAGS = -pipe -O3 -fPIC
PACKAGES =
INCLUDES = # `pkg-config --cflags $(PACKAGES)`
LIBS = # `pkg-config --libs $(PACKAGES)`
all: bsp bspdis libbsp.a
.PHONY: all clean distclean
clean:
rm -f *.a src/*.o src/lib/*.o lib/*.a bsp bspdis
distclean: clean
rm -f deps.mak
bsp: src/bsp.o libbsp.a
bspdis: src/bspdis.o libbsp.a
libbsp.a: \
src/lib/ec.o \
src/lib/ps.o \
src/lib/vm.o \
src/lib/sha1.o \
src/lib/ops.o \
src/lib/buf.o \
src/lib/stk.o \
src/lib/io.o \
src/lib/dis.o
%.a:
$(AR) r '$@' $^
%.o: %.c
$(CC) -c '$<' -o '$@' $(CFLAGS) $(INCLUDES)
bsp bspdis:
$(CCLD) $^ -o '$@' $(LDFLAGS) $(LIBS)
include install.mak
include deps.mak
include tests.mak
include cppcheck.mak
deps.mak:
( for f in src/*.c src/lib/*.c; do gcc -E -DMAKEDEPS=1 -I. -MM "$$f" -MT "$${f%.c}.o" $(CPPFLAGS) ; done ) > '$@'