-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
70 lines (48 loc) · 1.6 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CC = gcc
WARNS = -Wextra -Wno-unused-parameter -Wall -Wformat=2 -Wuninitialized \
-Wfloat-equal -Wshadow -Wpointer-arith \
-Wstrict-prototypes -Wmissing-prototypes -Wmaybe-uninitialized
REAL = double
LFLAGS = -std=c99 -pedantic -O3 -fPIC $(WARNS) -Werror -DREAL=$(REAL)
TFLAGS = -std=c99 -pedantic -O3 $(WARNS) -Werror -DREAL=$(REAL)
LIBS = -lm
OBJ = loci.o 1D.o 2D.o 3D.o 4D.o
TOBJ = runtests.o 1Dtest.o 2Dtest.o 3Dtest.o 4Dtest.o
BIN = bin
SRC = src
INCL = include
TEST = test
PYTEST = python/test
vpath %.c $(SRC):$(TEST)
vpath %.h $(INCL):$(TEST):$(SRC)
shlib : $(OBJ)
$(CC) $(LFLAGS) -shared $(OBJ) $(LIBS) -o lib/libloci.so
test : tfiles
$(BIN)/runtests
pytest : shlib
python $(PYTEST)/runtests.py
tfiles : $(OBJ) $(TOBJ)
$(CC) $(TFLAGS) $(OBJ) $(TOBJ) $(LIBS) -o $(BIN)/runtests
runtests.o : runtests.c runtests.h
$(CC) $(CFLAGS) $(LIBS) -c $<
loci.o : loci.c loci.h
$(CC) $(LFLAGS) $(LIBS) -c $<
1D.o : 1D.c 1D.h loci.h helpers.h
$(CC) $(LFLAGS) $(LIBS) -c $<
2D.o : 2D.c 2D.h loci.h helpers.h
$(CC) $(LFLAGS) $(LIBS) -c $<
3D.o : 3D.c 3D.h loci.h helpers.h
$(CC) $(LFLAGS) $(LIBS) -c $<
4D.o : 4D.c 4D.h loci.h helpers.h
$(CC) $(LFLAGS) $(LIBS) -c $<
1Dtest.o : 1Dtest.c test/runtests.h test/testhelpers.h
$(CC) $(TFLAGS) $(LIBS) -c $<
2Dtest.o : 2Dtest.c test/runtests.h test/testhelpers.h
$(CC) $(TFLAGS) $(LIBS) -c $<
3Dtest.o : 3Dtest.c test/runtests.h test/testhelpers.h
$(CC) $(TFLAGS) $(LIBS) -c $<
4Dtest.o : 4Dtest.c test/runtests.h test/testhelpers.h
$(CC) $(TFLAGS) $(LIBS) -c $<
.PHONY : clean
clean :
rm -f *.o lib/* $(BIN)/*