]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Refactor COMPILER and LINK commands into new variables
authorGuillem Jover <guillem@hadrons.org>
Sat, 30 Jan 2010 21:42:00 +0000 (22:42 +0100)
committerGuillem Jover <guillem@hadrons.org>
Sat, 30 Jan 2010 21:42:00 +0000 (22:42 +0100)
Makefile

index 5c5a6904f315f6947458dd9f91c6f68696b4756e..4e1ac28c99e25552f68a659aac8d75ebc7b07ee5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,6 +108,9 @@ CFLAGS ?= -g -Wall -Wextra -Wno-unused-variable
 
 MK_CFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
 
+COMPILE = $(CC) $(MK_CFLAGS) $(CFLAGS)
+LINK = $(CCLD)
+
 prefix         = /usr
 exec_prefix    =
 libdir         = ${exec_prefix}/lib
@@ -123,10 +126,10 @@ libs: $(LIB_STATIC) $(LIB_SHARED_SO) $(LIB_PKGCONFIG)
 man: $(LIB_MANS)
 
 %.lo: %.c
-       $(CC) -o $@ $(MK_CFLAGS) $(CFLAGS) -DPIC -fPIC -c $<
+       $(COMPILE) -o $@ -DPIC -fPIC -c $<
 
 %.o: %.c
-       $(CC) -o $@ $(MK_CFLAGS) $(CFLAGS) -c $<
+       $(COMPILE) -o $@ -c $<
 
 src/md5.3bsd:  src/mdX.3
        sed -e 's/mdX/md5/g' -e 's/mdY/md4/g' -e 's/MDX/MD5/g' $< > $@
@@ -152,7 +155,7 @@ $(LIB_SONAME): $(LIB_SHARED)
        ln -fs $^ $@
 
 $(LIB_SHARED): $(LIB_SHARED_OBJS)
-       $(CCLD) \
+       $(LINK) \
          -shared \
          -Wl,-soname -Wl,$(LIB_SONAME) \
          -Wl,--version-script=Versions \