test.c: Remove flog_assert(0)
[flog.git] / Makefile
blobbb127c62c621e42b03d94ee59103ff2510e9db6b
1 ##Config
2 CC = gcc
3 CFLAGS = -Wall -Os
4 LDFLAGS = -Wall -Os
5 ifdef DEBUG
6 CFLAGS += -g -DDEBUG
7 LDFLAGS += -g -DDEBUG
8 endif
9 LIB = libflog.a
10 DOXYGEN = doxygen
11 VALGRIND = valgrind -v --leak-check=full
13 ##Files
14 HEADER = config.h flog_msg_id.h flog.h flog_string.h flog_output_stdio.h flog_output_file.h
15 SRC = flog_msg_id.c flog.c flog_string.c flog_output_stdio.c flog_output_file.c
16 OBJ = $(SRC:.c=.o)
18 ##Rules
19 .PHONY : all lib clean distclean valgrind_test
21 all: lib
23 lib: $(LIB)
25 %.o: %.c
26 $(CC) $(CFLAGS) -c $< -o $@
28 $(LIB): $(OBJ) $(HEADER)
29 $(AR) r $(LIB) $(OBJ)
31 test: $(LIB) $(HEADER) test.o
32 $(CC) $(LDFLAGS) test.o $(LIB) -o $@
34 doxygen: Doxyfile $(SRC) $(HEADER)
35 $(DOXYGEN)
37 valgrind_test: test
38 $(VALGRIND) ./$<
40 clean:
41 $(RM) $(OBJ) $(LIB) test
43 distclean: clean
44 $(RM) -r doxygen
45 $(RM) *.log