The following commit has been merged in the master branch: commit 6c8503eef90b2134c5444f6d68b3d6c9a1166882 Author: Sven Eckelmann sven@narfation.org Date: Sat May 21 15:10:38 2011 +0200
batmand: Use standard-like build rules
User expect a specific naming inside makefile rules which they can modify by changing environment variables or providing them explicitely as parameters of the make call. The naming was extracted from the gnu make standard rules database.
Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/Makefile b/Makefile index a25f3fc..a0a7f88 100755 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ endif
ifeq ($(UNAME),GNU/kFreeBSD) OS_OBJ = $(BSD_OBJ) $(POSIX_OBJ) -LDFLAGS += -lfreebsd -lbsd +LDLIBS += -lfreebsd -lbsd endif
ifeq ($(UNAME),FreeBSD) @@ -53,9 +53,9 @@ OBJ = batman.o originator.o schedule.o list-batman.o allocate.o bitarray.o hash. #NO_POLICY_ROUTING = -DNO_POLICY_ROUTING
# batmand flags and options -CFLAGS += -pedantic -Wall -W -std=gnu99 -EXTRA_CFLAGS = -DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA $(NO_POLICY_ROUTING) -DREVISION_VERSION=$(REVISION_VERSION) -LDFLAGS += -lpthread +CFLAGS += -pedantic -Wall -W -std=gnu99 -MD +CPPFLAGS = -DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA $(NO_POLICY_ROUTING) -DREVISION_VERSION=$(REVISION_VERSION) +LDLIBS += -lpthread
# disable verbose output ifneq ($(findstring $(MAKEFLAGS),s),s) @@ -69,6 +69,8 @@ endif
# standard build tools CC ?= gcc +COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c +LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
# standard install paths SBINDIR = $(INSTALL_PREFIX)/usr/sbin @@ -83,10 +85,10 @@ all: $(BINARY_NAME) # standard build rules .SUFFIXES: .o .c .c.o: - $(Q_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MD -c $< -o $@ + $(COMPILE.c) -o $@ $<
-$(BINARY_NAME): $(OBJ) Makefile - $(Q_LD)$(CC) -o $@ $(OBJ) $(LDFLAGS) +$(BINARY_NAME): $(OBJ) + $(LINK.o) $^ $(LDLIBS) -o $@
clean: rm -f $(BINARY_NAME) $(OBJ) $(DEP)