From patchwork Wed Feb 19 23:14:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 24969 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 260172054E for ; Wed, 19 Feb 2014 23:15:04 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf4163794iec.8 for ; Wed, 19 Feb 2014 15:15:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:to:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=PXEPjCgmSxg6Ku2NVsIlt4dlLi+x5CSUpQTOKKZsBu0=; b=hlBSmHSsuIvubt7LVb9p7r8DaMp4uk72uGjXhRTTrD8CC/e8IRWuLz7d/TviDVSNMD tnI01fgVfrtAaIxXfiZ9nTziafCNxtnD1qg/Ut9soHZ5KMOW9IA0stQt1Br9COcJBn46 0XcpzhpN0teHYBzNLxsNVooXo/IOJxiO5GOR2xiT2eNVcwz0NYINfXSwdEw4wdWR9kyg kxcj98grSYxuPZMpv/GgM0oxJdaIiLRYAwOvF1GXsuxmAczRoOslpdz4Ug2eCbpQCG3z MQVLr0GXenARFkC2Nlxs1dlqM/IPM0vaU5P0nBCxmD1kRXYVhIOFqWVa0Usa0xpEphqU PuiA== X-Gm-Message-State: ALoCoQkQW2Y5FbKzdpvYABp69O4qfJHavN+p3Hfl2Nzh7yBfRxkiXx+xJfg9DlB2GA8DqWLbHaqs X-Received: by 10.42.78.197 with SMTP id o5mr15222820ick.9.1392851703887; Wed, 19 Feb 2014 15:15:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: lng-odp@linaro.org Received: by 10.140.36.200 with SMTP id p66ls300970qgp.74.gmail; Wed, 19 Feb 2014 15:15:03 -0800 (PST) X-Received: by 10.224.14.70 with SMTP id f6mr54865106qaa.31.1392851703658; Wed, 19 Feb 2014 15:15:03 -0800 (PST) Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by mx.google.com with ESMTPS id t3si755391qar.109.2014.02.19.15.15.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 15:15:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.43 is neither permitted nor denied by best guess record for domain of mike.holmes@linaro.org) client-ip=209.85.216.43; Received: by mail-qa0-f43.google.com with SMTP id o15so1812928qap.16 for ; Wed, 19 Feb 2014 15:15:03 -0800 (PST) X-Received: by 10.140.92.65 with SMTP id a59mr50874675qge.34.1392851703461; Wed, 19 Feb 2014 15:15:03 -0800 (PST) Received: from fedora1.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id u4sm5656687qai.21.2014.02.19.15.15.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 15:15:02 -0800 (PST) From: Mike Holmes To: lng-odp@linaro.org Subject: [lng-odp] [PATCH] Makefiles: Allow CFLAGS to overide the build Date: Wed, 19 Feb 2014 18:14:58 -0500 Message-Id: <1392851698-31979-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.43 is neither permitted nor denied by best guess record for domain of mike.holmes@linaro.org) smtp.mail=mike.holmes@linaro.org Precedence: list Mailing-list: list lng-odp@linaro.org; contact lng-odp+owners@linaro.org List-ID: X-Google-Group-Id: 474323889996 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Mike Holmes --- clean up other minor issues seen in LDFLAGS .checkpatch.conf | 1 + Makefile.inc | 15 +++++++-------- platform/linux-generic/Makefile | 10 +++++----- test/Makefile.inc | 4 ++-- test/api_test/Makefile | 6 +++--- test/example/Makefile | 2 +- test/packet/Makefile | 4 ++-- test/packet_netmap/Makefile | 5 ++--- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.checkpatch.conf b/.checkpatch.conf index e1a25c8..9076410 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -1,3 +1,4 @@ --no-tree --strict --ignore=NEW_TYPEDEFS +--ignore=DEPRECATED_VARIABLE diff --git a/Makefile.inc b/Makefile.inc index 523385d..fd7d435 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -4,17 +4,16 @@ # SPDX-License-Identifier: BSD-3-Clause PLATFORM ?= linux-generic -CFLAGS += -DODP_DEBUG=1 -CFLAGS += -O3 -#CFLAGS += -O0 -g +EXTRA_CFLAGS += -DODP_DEBUG=1 +EXTRA_CFLAGS += -O3 OBJ_DIR = ./obj DESTDIR ?= $(ODP_ROOT)/build -CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith -CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -CFLAGS += -Wformat-security -Wundef -Wwrite-strings +EXTRA_CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes +EXTRA_CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith +EXTRA_CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral +EXTRA_CFLAGS += -Wformat-security -Wundef -Wwrite-strings CC ?= gcc LD ?= gcc @@ -26,5 +25,5 @@ RMDIR := rm -rf RM := rm -f COPY := cp -r -CFLAGS += -pthread +EXTRA_CFLAGS += -pthread LDFLAGS += -pthread diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile index b640928..9284a0a 100644 --- a/platform/linux-generic/Makefile +++ b/platform/linux-generic/Makefile @@ -32,12 +32,12 @@ ODP_ROOT = ../.. LIB_DIR = ./lib DOC_DIR = ./doc -CFLAGS += -I$(ODP_ROOT)/include -CFLAGS += -I./include -CFLAGS += -I./include/api +EXTRA_CFLAGS += -I$(ODP_ROOT)/include +EXTRA_CFLAGS += -I./include +EXTRA_CFLAGS += -I./include/api ifeq ($(ODP_HAVE_NETMAP),yes) -CFLAGS += -DODP_HAVE_NETMAP +EXTRA_CFLAGS += -DODP_HAVE_NETMAP endif include $(ODP_ROOT)/Makefile.inc @@ -93,7 +93,7 @@ $(DOC_DIR): # $(OBJ_DIR)/%.o: ./source/%.c $(ECHO) Compiling $< - $(CC) -c -MD $(CFLAGS) -o $@ $< + $(CC) -c -MD $(EXTRA_CFLAGS) $(CFLAGS) -o $@ $< # # Lib rule diff --git a/test/Makefile.inc b/test/Makefile.inc index 72bbebd..63feecf 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -5,8 +5,8 @@ ODP_TEST_ROOT = $(ODP_ROOT)/test -CFLAGS += -I$(DESTDIR)/include +EXTRA_CFLAGS += -I$(DESTDIR)/include LIB = -L$(DESTDIR)/lib -lodp LDFLAGS += -lrt -LDFLAGS += $(EXTRA_CFLAGS) +#LDFLAGS += $(CFLAGS) diff --git a/test/api_test/Makefile b/test/api_test/Makefile index 15c18f4..741fbe4 100644 --- a/test/api_test/Makefile +++ b/test/api_test/Makefile @@ -12,12 +12,12 @@ ODP_ATOMIC = odp_atomic ODP_SHM = odp_shm ODP_RING = odp_ring -CFLAGS += -I$(ODP_ROOT)/platform/linux-generic/include +EXTRA_CFLAGS += -I$(ODP_ROOT)/platform/linux-generic/include include ../Makefile.inc include $(ODP_ROOT)/Makefile.inc -CFLAGS += -I$(ODP_TEST_ROOT)/api_test +EXTRA_CFLAGS += -I$(ODP_TEST_ROOT)/api_test ATOMIC_OBJS = ATOMIC_OBJS += $(OBJ_DIR)/odp_common.o @@ -52,7 +52,7 @@ $(OBJ_DIR): $(DESTDIR)/lib/libodp.a # $(OBJ_DIR)/%.o: %.c $(ECHO) Compiling $< - $(CC) -c -MD $(CFLAGS) -o $@ $< + $(CC) -c -MD $(EXTRA_CFLAGS) $(CFLAGS) -o $@ $< # # Link rule diff --git a/test/example/Makefile b/test/example/Makefile index d43e780..8064977 100644 --- a/test/example/Makefile +++ b/test/example/Makefile @@ -30,7 +30,7 @@ $(OBJ_DIR): $(DESTDIR)/lib/libodp.a # $(OBJ_DIR)/%.o: %.c $(ECHO) Compiling $< - $(CC) -c -MD $(CFLAGS) -o $@ $< + $(CC) -c -MD $(EXTRA_CFLAGS) $(CFLAGS) -o $@ $< # # Link rule diff --git a/test/packet/Makefile b/test/packet/Makefile index f1cb7d9..c66b37c 100644 --- a/test/packet/Makefile +++ b/test/packet/Makefile @@ -9,7 +9,7 @@ ODP_APP = odp_packet include ../Makefile.inc include $(ODP_ROOT)/Makefile.inc -CFLAGS += -I$(ODP_TEST_ROOT)/packet +EXTRA_CFLAGS += -I$(ODP_TEST_ROOT)/packet OBJS = OBJS += $(OBJ_DIR)/odp_example_pktio.o @@ -32,7 +32,7 @@ $(OBJ_DIR): $(DESTDIR)/lib/libodp.a # $(OBJ_DIR)/%.o: %.c $(ECHO) Compiling $< - $(CC) -c -MD $(CFLAGS) -o $@ $< + $(CC) -c -MD $(EXTRA_CFLAGS) $(CFLAGS) -o $@ $< # # Link rule diff --git a/test/packet_netmap/Makefile b/test/packet_netmap/Makefile index 5febb33..8d5e5e8 100644 --- a/test/packet_netmap/Makefile +++ b/test/packet_netmap/Makefile @@ -6,8 +6,7 @@ ODP_ROOT = ../.. ODP_APP = odp_packet -CFLAGS += -DODP_HAVE_NETMAP -CFLAGS += -O0 -g +EXTRA_CFLAGS += -DODP_HAVE_NETMAP include ../Makefile.inc include $(ODP_ROOT)/Makefile.inc @@ -33,7 +32,7 @@ $(OBJ_DIR): $(DESTDIR)/lib/libodp.a # $(OBJ_DIR)/%.o: %.c $(ECHO) Compiling $< - $(CC) -c -MD $(CFLAGS) -o $@ $< + $(CC) -c -MD $(EXTRA_CFLAGS) $(CFLAGS) -o $@ $< # # Link rule