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>
-# Include "Config" if already generated
-ifneq ($(wildcard Config),)
-include Config
-endif
+# Top level Makefile for iproute2
ifeq ($(VERBOSE),0)
MAKEFLAGS += --no-print-directory
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); \
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)
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)
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)
+include ../Config
+
DISTGEN = maketable normal pareto paretonormal
DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
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):