-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
41 lines (30 loc) · 806 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
.PHONY: libcora lib fmt
CC = gcc
CFLAGS = -g -Wall -fPIC
LD_FLAG := -lcora -ldl
ifeq ("${ENABLE_ASAN}", "1")
LD_FLAG = -lasan -lcora -ldl
endif
all: cora.bin lib
libcora:
make -C src
lib:
make -C lib
.c.o:
$(CC) $(CFLAGS) -c $< -I src
main.o: main.c
cora.bin: libcora main.o init.so toc.so
# $(CC) main.o -Wl,-rpath src -Lsrc -lcora -ldl -o $@
# $(CC) main.o -Lsrc -l:libcora.a -ldl -o $@
# $(CC) main.o -Lsrc -l:libcora.a lib/lib.a -ldl -o $@
$(CC) main.o -Lsrc $(LD_FLAG) -o $@
clean:
rm -f *.o *.so *.bin
make clean -C src
make clean -C lib
toc.so: toc.c libcora
gcc -shared -o toc.so -g -fPIC toc.c -Isrc -I. -Lsrc -lcora
init.so: init.c libcora
gcc -shared -o init.so -g -fPIC init.c -Isrc -I. -Lsrc -lcora
fmt:
cd src; indent -npcs -bap -br -ce -brf -ut -i8 -nbbo -nhnl *.c