t004-makefile.diff - mkports - recipes for building multiple softwares with mk(1)
 (HTM) git clone git://z3bra.org/mkports
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       t004-makefile.diff (1791B)
       ---
            1 From c66609d2c830d6fe06f48f5d38c54eb5cc6f2975 Mon Sep 17 00:00:00 2001
            2 From: Mike Frysinger <vapier@gentoo.org>
            3 Date: Thu, 24 Jan 2013 23:36:16 -0500
            4 Subject: [PATCH [iputils]] fix handling of CFLAGS
            5 
            6 This defaults CFLAGS to -O3 without clobbering settings people have set
            7 up in the environment already.
            8 
            9 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
           10 ---
           11  Makefile | 13 +++++--------
           12  1 file changed, 5 insertions(+), 8 deletions(-)
           13 
           14 diff --git a/Makefile b/Makefile
           15 index 2c49940..ecabac3 100644
           16 --- a/Makefile
           17 +++ b/Makefile
           18 @@ -2,8 +2,6 @@
           19  # Configuration
           20  #
           21  
           22 -# CC
           23 -CC=gcc
           24  # Path to parent kernel include files directory
           25  LIBC_INCLUDE=/usr/include
           26  # Libraries
           27 @@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no
           28  
           29  # -------------------------------------
           30  # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
           31 -# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
           32 -CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
           33 -CCOPTOPT=-O3
           34 -GLIBCFIX=-D_GNU_SOURCE
           35 -DEFINES=
           36 +# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
           37 +CFLAGS?=-O3 -g
           38 +CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall
           39 +CPPFLAGS+=-D_GNU_SOURCE
           40  LDLIB=
           41  
           42  FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2))
           43 @@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
           44  IPV6_TARGETS=tracepath6 traceroute6 ping6
           45  TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
           46  
           47 -CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
           48  LDLIBS=$(LDLIB) $(ADDLIB)
           49  
           50  UNAME_N:=$(shell uname -n)
           51 @@ -132,6 +128,7 @@ all: $(TARGETS)
           52          $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@
           53  %.o: %.c
           54          $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@
           55 +LINK.o += $(CFLAGS)
           56  $(TARGETS): %: %.o
           57          $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@
           58  
           59 -- 
           60 1.8.0.2
           61