Improve performance and code size
[flog.git] / Makefile
blobbb54a46406b3d4e74ad88177bdb6c3bc4c959cbb
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 DOXYGEN = doxygen
10 VALGRIND = valgrind -v --leak-check=full
12 ##Files
13 HEADER = config.h flog_msg_id.h flog.h flog_string.h flog_output_stdio.h flog_output_file.h
14 SRC = flog_msg_id.c flog.c flog_string.c flog_output_stdio.c flog_output_file.c test.c
15 OBJ = $(SRC:.c=.o)
17 ##Rules
18 .PHONY : all clean distclean valgrind_test
20 all: test
22 %.o: %.c
23 $(CC) $(CFLAGS) -c $< -o $@
25 test: $(OBJ) $(HEADER)
26 $(CC) $(LDFLAGS) $(OBJ) -o $@
28 doxygen: Doxyfile $(SRC) $(HEADER)
29 $(DOXYGEN)
31 valgrind_test: test
32 $(VALGRIND) ./$<
34 clean:
35 $(RM) $(OBJ) test
37 distclean: clean
38 $(RM) -r doxygen