-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
44 lines (30 loc) · 959 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
MOSFHET_DIR = ./
include Makefile.def
BENCH=benchmark.c
all: mosfhet
static: lib objects
ar rcs lib/libmosfhet.a *.o && rm *.o
objects: $(SRC_MOSFHET)
$(CC) -g -c $^ $(LIB_FLAGS) $(LIBS)
test: test/test
./test/test
bench: test/benchmark
./test/benchmark
mosfhet: lib lib/mosfhet
lib/mosfhet: $(SRC_MOSFHET)
$(CC) -g -fPIC -shared -o lib/libmosfhet.so $^ $(LIB_FLAGS) $(LIBS)
lib:
mkdir -p lib
test_debug: override TEST_FLAGS = $(DEBUG_FLAGS) -Dinline=""
test_debug: test/test
gdb ./test/test
test/test: $(SRC_MOSFHET) test/unity_test/unity.c test/tests.c
$(CC) -g -o test/test $^ $(TEST_FLAGS) $(LIBS)
test/benchmark: $(SRC_MOSFHET) test/$(BENCH)
$(CC) -g -o test/benchmark $^ $(OPT_FLAGS) $(LIBS)
test_fft: test/test_fft
./test/test_fft
test/test_fft: $(SRC_MOSFHET) test/benchmark_arith.c
$(CC) -g -o test/test_fft $^ $(TEST_FLAGS) $(LIBS)
clean:
rm --f test/test test/benchmark test/test_fft lib/libmosfhet.so lib/libmosfhet.a