-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 1003 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
51
# makefile to build object files from source files
# compiler
CC = gcc
# archiver
AR = ar
# compiler flags
CFLAGS = -shared
# libraries for test target:
# should later use gart-config when it will be available
LIBS = -Lsrc -lgart -Lsrc/gcstory -lgcstory \
$(shell ncurses6-config --cflags --libs) -ltermbox
# include path
INC = include
# include directories
INCLUDE = -I$(INC)
# phony target
.PHONY: all clean clean-all
# default
all:
-$(MAKE) -C src
-$(MAKE) -C src/gcstory
# test dynamic library
test:
@$(CC) $(INCLUDE) -D_ART=1 tests/test.c $(LIBS) -o tests/$@ \
-Wl,-rpath=$(shell pwd)/src,-rpath=$(shell pwd)/src/gcstory
@tests/$@
# test static library
# test-static:
# @$(CC) -static tests/test.c $(LIBS) -o tests/$@
# @./tests/$@
# clean up generated object files
clean:
-$(MAKE) -C src clean
-$(MAKE) -C src/gcstory clean
# clean up all generated files
clean-all: clean
-$(MAKE) -C src clean-all
-$(MAKE) -C src/gcstory clean-all
-rm -f tests/test tests/test-static