fix bug in handling of FLOG_MSG_T.src_line (changed from signed to unsigned)
[flog.git] / Makefile
bloba5fb5c8981e2afbb2d602221c8550445c1e4fc8a
1 ##Config
2 CC = gcc
3 CFLAGS = -W -Wall -Os
4 LDFLAGS = -W -Wall -Os
5 ifdef DEBUG
6 CFLAGS += -g -DDEBUG
7 LDFLAGS += -g -DDEBUG
8 endif
9 ifdef PROFILE
10 CFLAGS += -pg
11 LDFLAGS += -pg
12 endif
13 LIB = libflog.a
14 DOXYGEN = doxygen
15 VALGRIND = valgrind -v --leak-check=full
17 ##Files
18 HEADER = config.h flog_msg_id.h flog.h flog_string.h flog_output_stdio.h flog_output_file.h
19 SRC = flog_msg_id.c flog.c flog_string.c flog_output_stdio.c flog_output_file.c
20 OBJ = $(SRC:.c=.o)
22 ##Rules
23 .PHONY : all lib clean distclean valgrind_test
25 all: lib
27 lib: $(LIB)
29 %.o: %.c $(HEADER)
30 $(CC) $(CFLAGS) -c $< -o $@
32 $(LIB): $(OBJ) $(HEADER)
33 $(AR) r $(LIB) $(OBJ)
35 test: $(LIB) $(HEADER) test.o
36 $(CC) $(LDFLAGS) test.o $(LIB) -o $@
38 doxygen: Doxyfile $(SRC) $(HEADER)
39 $(DOXYGEN)
41 valgrind_test: test
42 $(VALGRIND) ./$<
44 clean:
45 $(RM) $(OBJ) $(LIB) test.o test
47 distclean: clean
48 $(RM) -r doxygen
49 $(RM) *.log