]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
change how Config is used in Makefile's
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 9 Aug 2017 15:45:04 +0000 (08:45 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 9 Aug 2017 16:10:52 +0000 (09:10 -0700)
The recent LIBMNL changes was made more difficult to debug because
of how Config is handle in clean make. The Config file is generated
by top level make, but since it is not recursive, the values generated
would not be visible on a clean make.

The change is to not include Config in top level make, and move
all the conditionals down into sub makefiles. Not ideal, but beter
than going full autoconf route. Or forcing separate configure
step.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Makefile
bridge/Makefile
genl/Makefile
misc/Makefile
netem/Makefile

index a4b0dea58fd81709534c2fb33fc687a0ffea54ab..1f88f7f5669183c4170b0df0f8d065c6da271f2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,4 @@
-# Include "Config" if already generated
-ifneq ($(wildcard Config),)
-include Config
-endif
+# Top level Makefile for iproute2
 
 ifeq ($(VERBOSE),0)
 MAKEFLAGS += --no-print-directory
@@ -57,16 +54,6 @@ SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
 LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
 LDLIBS += $(LIBNETLINK)
 
-ifeq ($(HAVE_ELF),y)
-       CFLAGS += -DHAVE_ELF
-       LDLIBS += -lelf
-endif
-
-ifeq ($(HAVE_MNL),y)
-       CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
-       LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
-endif
-
 all: Config
        @set -e; \
        for i in $(SUBDIRS); \
index 634c370a3c0129a93cbf55b8b8908b0bdb9ee23a..fa448ea2e4fa83c268d84e1ee80adc9460ac6d08 100644 (file)
@@ -6,6 +6,11 @@ ifeq ($(IP_CONFIG_SETNS),y)
        CFLAGS += -DHAVE_SETNS
 endif
 
+ifeq ($(HAVE_MNL),y)
+       CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
+       LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
+endif
+
 all: bridge
 
 bridge: $(BROBJ) $(LIBNETLINK)
index f5a0bfe42aff4b9a6cd603fe8aa5e2cdb4182a6b..f0efe1ac66473a9f501c1e1a9fc97e3992dd405f 100644 (file)
@@ -17,6 +17,11 @@ LDFLAGS += -Wl,-export-dynamic
 LDLIBS  += -lm -ldl
 endif
 
+ifeq ($(HAVE_MNL),y)
+       CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
+       LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
+endif
+
 all: genl
 
 genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
index 814a72fcb0745e07c9644216cf988504e0ce6814..fa90308e4848ed3e2f57713376b3da759e6b6e57 100644 (file)
@@ -18,6 +18,11 @@ ifeq ($(IP_CONFIG_SETNS),y)
        CFLAGS += -DHAVE_SETNS
 endif
 
+ifeq ($(HAVE_MNL),y)
+       CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
+       LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
+endif
+
 all: $(TARGETS)
 
 ss: $(SSOBJ)
index a68e2fdb30376a294df8a1897c060e7bd143ef94..2499f086f24d524746044053eee61ca34000c6d3 100644 (file)
@@ -1,3 +1,5 @@
+include ../Config
+
 DISTGEN = maketable normal pareto paretonormal
 DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
 
@@ -5,6 +7,11 @@ HOSTCC ?= $(CC)
 CCOPTS  = $(CBUILD_CFLAGS)
 LDLIBS += -lm
 
+ifeq ($(HAVE_MNL),y)
+       CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
+       LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
+endif
+
 all: $(DISTGEN) $(DISTDATA)
 
 $(DISTGEN):