From patchwork Wed Jun 1 03:48:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 628458 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rKGYF3qSPz9t6j for ; Wed, 1 Jun 2016 13:48:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757204AbcFADsb (ORCPT ); Tue, 31 May 2016 23:48:31 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:58832 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754676AbcFADsa (ORCPT ); Tue, 31 May 2016 23:48:30 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8EAA4340C77; Wed, 1 Jun 2016 03:48:29 +0000 (UTC) From: Mike Frysinger To: YOSHIFUJI Hideaki Cc: netdev@vger.kernel.org Subject: [PATCH iputils 4/6] fix handling of CFLAGS Date: Tue, 31 May 2016 23:48:23 -0400 Message-Id: <1464752905-10347-4-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1464752905-10347-1-git-send-email-vapier@gentoo.org> References: <1464752905-10347-1-git-send-email-vapier@gentoo.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This defaults CFLAGS to -O3 without clobbering settings people have set up in the environment already. Signed-off-by: Mike Frysinger --- Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7147f08..362f1c8 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,6 @@ # Configuration # -# CC -CC=gcc # Path to parent kernel include files directory LIBC_INCLUDE=/usr/include # Libraries @@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no # ------------------------------------- # What a pity, all new gccs are buggy and -Werror does not work. Sigh. -# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g -CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g -CCOPTOPT=-O3 -GLIBCFIX=-D_GNU_SOURCE -DEFINES= +# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g +CFLAGS?=-O3 -g +CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall +CPPFLAGS+=-D_GNU_SOURCE LDLIB= FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2)) @@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd IPV6_TARGETS=tracepath6 traceroute6 ping6 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) -CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES) LDLIBS=$(LDLIB) $(ADDLIB) UNAME_N:=$(shell uname -n) @@ -132,6 +128,7 @@ all: $(TARGETS) $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@ %.o: %.c $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@ +LINK.o += $(CFLAGS) $(TARGETS): %: %.o $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@