From e16844f6b8b6fdc6edae2bf47cda42f8ffe89d0c Mon Sep 17 00:00:00 2001 From: Nabeel Sowan Date: Tue, 14 Apr 2009 13:55:30 +0200 Subject: [PATCH] improve Makefile, edit config.h slightly --- Makefile | 19 +++++++++++++------ config.h | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index bb54a46..bb127c6 100644 --- a/Makefile +++ b/Makefile @@ -6,24 +6,30 @@ ifdef DEBUG CFLAGS += -g -DDEBUG LDFLAGS += -g -DDEBUG endif +LIB = libflog.a DOXYGEN = doxygen VALGRIND = valgrind -v --leak-check=full ##Files HEADER = config.h flog_msg_id.h flog.h flog_string.h flog_output_stdio.h flog_output_file.h -SRC = flog_msg_id.c flog.c flog_string.c flog_output_stdio.c flog_output_file.c test.c +SRC = flog_msg_id.c flog.c flog_string.c flog_output_stdio.c flog_output_file.c OBJ = $(SRC:.c=.o) ##Rules -.PHONY : all clean distclean valgrind_test +.PHONY : all lib clean distclean valgrind_test -all: test +all: lib + +lib: $(LIB) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ -test: $(OBJ) $(HEADER) - $(CC) $(LDFLAGS) $(OBJ) -o $@ +$(LIB): $(OBJ) $(HEADER) + $(AR) r $(LIB) $(OBJ) + +test: $(LIB) $(HEADER) test.o + $(CC) $(LDFLAGS) test.o $(LIB) -o $@ doxygen: Doxyfile $(SRC) $(HEADER) $(DOXYGEN) @@ -32,7 +38,8 @@ valgrind_test: test $(VALGRIND) ./$< clean: - $(RM) $(OBJ) test + $(RM) $(OBJ) $(LIB) test distclean: clean $(RM) -r doxygen + $(RM) *.log diff --git a/config.h b/config.h index 5113607..1f90339 100644 --- a/config.h +++ b/config.h @@ -29,9 +29,9 @@ //! @def FLOG_CONFIG_ABORT_ON_ASSERT //! If defined then flog_assert() will call abort() on assertion failure. -//! This behaviour can be! switched off for deeply embedded systems where +//! This behaviour can be switched off for deeply embedded systems where //! calling abort() doesn't make any sense. -//#define FLOG_CONFIG_ABORT_ON_ASSERT +#define FLOG_CONFIG_ABORT_ON_ASSERT //! @def FLOG_CONFIG_TIMESTAMP -- 2.11.4.GIT