few updates
[valse.git] / test / Makefile
1 CC = gcc
2 CFLAGS = -g -std=gnu99 -Wno-implicit-function-declaration
3 LDFLAGS = -lm -lgsl -lcblas
4 TEST_LDFLAGS = -L. libvalse_core.so
5 LIB = libvalse_core.so
6 LIB_SRC = $(wildcard ../pkg/src/sources/*.c)
7 LIB_OBJ = $(LIB_SRC:.c=.o)
8 INCLUDES = -I../pkg/src/sources
9 TESTS = test.EMGLLF test.EMGrank
10
11 all: $(LIB) $(TESTS)
12
13 $(LIB): $(LIB_OBJ)
14 $(CC) -shared -o $@ $^ $(LDFLAGS)
15
16 test.EMGLLF: $(LIB) test.EMGLLF.o test_utils.o
17 $(CC) -o $@ $^ $(LDFLAGS) $(TEST_LDFLAGS)
18
19 test.EMGrank: $(LIB) test.EMGrank.o test_utils.o
20 $(CC) -o $@ $^ $(LDFLAGS) $(TEST_LDFLAGS)
21
22 %.o: %.c
23 $(CC) -fPIC -o $@ -c $< $(CFLAGS) $(INCLUDES)
24
25 clean:
26 rm -f *.o ../pkg/src/sources/*.o
27
28 cclean: clean
29 rm -f *.so $(TESTS)
30
31 .PHONY: all clean cclean