diff mbox

Makefile cleanup continued

Message ID 1393336028-15009-1-git-send-email-petri.savolainen@linaro.org
State Accepted, archived
Commit 67d078bc4bb5ec9a623e0320f120e262c3c9f911
Headers show

Commit Message

Petri Savolainen Feb. 25, 2014, 1:47 p.m. UTC
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 Makefile.inc                | 26 ++++++++++++++------------
 test/api_test/Makefile      |  2 --
 test/example/Makefile       |  5 +----
 test/packet/Makefile        |  2 --
 test/packet_netmap/Makefile |  1 -
 5 files changed, 15 insertions(+), 21 deletions(-)
diff mbox

Patch

diff --git a/Makefile.inc b/Makefile.inc
index 0b27bd9..a5aeb8b 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -4,31 +4,33 @@ 
 # SPDX-License-Identifier:	BSD-3-Clause
 
 PLATFORM ?= linux-generic
-EXTRA_CFLAGS  += -DODP_DEBUG=1
-EXTRA_CFLAGS  += -O3
-
-OBJ_DIR  = ./obj
+OBJ_DIR   = ./obj
 ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
 
-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
 AR     ?= ar
-
 ECHO   := @echo
 MKDIR  := mkdir -p
 RMDIR  := rm -rf
 RM     := rm -f
 COPY   := cp -r
 
-EXTRA_CFLAGS  += -pthread
+EXTRA_CFLAGS += -DODP_DEBUG=1
+EXTRA_CFLAGS += -O3
+#EXTRA_CFLAGS += -O0 -g
+EXTRA_CFLAGS += -pthread
+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
+
+
 LDFLAGS += -pthread
-LDFLAGS += -lrt
-LDFLAGS += $(EXTRA_CFLAGS)
+LDFLAGS += $(CFLAGS)
+
+STD_LIBS += -lrt
 
 .PHONY: default
 default:
diff --git a/test/api_test/Makefile b/test/api_test/Makefile
index 1748c45..ea3dbc4 100644
--- a/test/api_test/Makefile
+++ b/test/api_test/Makefile
@@ -12,8 +12,6 @@  ODP_ATOMIC    = odp_atomic
 ODP_SHM       = odp_shm
 ODP_RING      = odp_ring
 
-EXTRA_CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
-
 include $(ODP_ROOT)/Makefile.inc
 include ../Makefile.inc
 
diff --git a/test/example/Makefile b/test/example/Makefile
index 1774b83..2dc148a 100644
--- a/test/example/Makefile
+++ b/test/example/Makefile
@@ -12,9 +12,6 @@  include ../Makefile.inc
 .PHONY: default
 default: $(OBJ_DIR) $(ODP_APP)
 
-
-CFLAGS  += -I.
-
 OBJS     =
 OBJS    += $(OBJ_DIR)/odp_example.o
 
@@ -35,7 +32,7 @@  $(OBJ_DIR)/%.o: %.c
 #
 $(ODP_APP): $(ODP_LIB) $(OBJS)
 	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
+	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 .PHONY: clean
 clean:
diff --git a/test/packet/Makefile b/test/packet/Makefile
index 87227ae..b4c0e5b 100644
--- a/test/packet/Makefile
+++ b/test/packet/Makefile
@@ -6,8 +6,6 @@ 
 ODP_ROOT = ../..
 ODP_APP  = odp_packet
 
-EXTRA_CFLAGS  += -I.
-
 include $(ODP_ROOT)/Makefile.inc
 include ../Makefile.inc
 
diff --git a/test/packet_netmap/Makefile b/test/packet_netmap/Makefile
index 4cbf071..d1bf807 100644
--- a/test/packet_netmap/Makefile
+++ b/test/packet_netmap/Makefile
@@ -6,7 +6,6 @@ 
 ODP_ROOT = ../..
 ODP_APP  = odp_packet
 
-EXTRA_CFLAGS  += -I.
 EXTRA_CFLAGS  += -DODP_HAVE_NETMAP
 
 include $(ODP_ROOT)/Makefile.inc