Skip to contentSkip to conversation

mk: add makefile extention support

PATCH In review Keith Wiles 2 participants 9 messages Feb 9, 2016 – Mar 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: add makefile extention support

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

---
 mk/internal/rte.extvars.mk |  2 +-
 mk/rte.bsdmodule.mk        |  6 +++---
 mk/rte.extsubdir.mk        |  2 +-
 mk/rte.module.mk           |  6 +++---
 mk/rte.sdkbuild.mk         | 10 +++++-----
 mk/rte.sdkconfig.mk        |  6 +++---
 mk/rte.sdkdepdirs.mk       | 10 +++++-----
 mk/rte.sdkgcov.mk          |  2 +-
 mk/rte.sdktest.mk          |  2 +-
 mk/rte.subdir.mk           | 14 +++++++-------
 10 files changed, 30 insertions(+), 30 deletions(-)
mk/internal/rte.extvars.mk +1 -1
index 040d39f..3361551 100644
@@ -48,7 +48,7 @@ ifeq ("$(origin M)", "command line")
 RTE_EXTMK := $(abspath $(M))
 endif
 endif
-RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
+RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX)
 export RTE_EXTMK
 
 # RTE_SDK_BIN must point to .config, include/ and lib/.
mk/rte.bsdmodule.mk +3 -3
index 86b92ff..e8a504a 100644
@@ -80,7 +80,7 @@ build: _postbuild
 
 # build module
 $(MODULE).ko: $(SRCS_LINKS)
-	$(Q)if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	$(Q)if [ ! -f $(notdir Makefile)$(RTE_MKFILE_SUFFIX) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	$(Q)if [ ! -f $(notdir BSDmakefile) ]; then ln -nfs $(SRCDIR)/BSDmakefile . ; fi
 	$(Q)MAKEFLAGS= $(BSDMAKE)
 
@@ -100,11 +100,11 @@ clean: _postclean
 # do a make clean and remove links
 .PHONY: doclean
 doclean:
-	$(Q)if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	$(Q)if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	$(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) clean
 	$(Q)$(foreach FILE,$(SRCS-y) $(SRCS-n) $(SRCS-),\
 		if [ -h $(notdir $(FILE)) ]; then rm -f $(notdir $(FILE)) ; fi ;)
-	$(Q)if [ -h $(notdir Makefile) ]; then rm -f $(notdir Makefile) ; fi
+	$(Q)if [ -h $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then rm -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ; fi
 	$(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS) \
 		$(INSTALL-FILES-all)
 
mk/rte.extsubdir.mk +1 -1
index f50f006..55d4e16 100644
@@ -45,7 +45,7 @@ clean: $(DIRS-y)
 $(DIRS-y):
 	@echo "== $@"
 	$(Q)$(MAKE) -C $(@) \
-		M=$(CURDIR)/$(@)/Makefile \
+		M=$(CURDIR)/$(@)/Makefile$(RTE_MKFILE_SUFFIX) \
 		O=$(BASE_OUTPUT)/$(CUR_SUBDIR)/$(@)/$(RTE_TARGET) \
 		BASE_OUTPUT=$(BASE_OUTPUT) \
 		CUR_SUBDIR=$(CUR_SUBDIR)/$(@) \
mk/rte.module.mk +3 -3
index 53ed4fe..6477bbe 100644
@@ -76,7 +76,7 @@ build: _postbuild
 
 # build module
 $(MODULE).ko: $(SRCS_LINKS)
-	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	@if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	@$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \
 		CC="$(KERNELCC)" CROSS_COMPILE=$(CROSS) V=$(if $V,1,0)
 
@@ -97,11 +97,11 @@ clean: _postclean
 # do a make clean and remove links
 .PHONY: doclean
 doclean:
-	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	@if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	$(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) clean
 	@$(foreach FILE,$(SRCS-y) $(SRCS-n) $(SRCS-),\
 		if [ -h $(notdir $(FILE)) ]; then rm -f $(notdir $(FILE)) ; fi ;)
-	@if [ -h $(notdir Makefile) ]; then rm -f $(notdir Makefile) ; fi
+	@if [ -h $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then rm -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ; fi
 	@rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS) \
 		$(INSTALL-FILES-all)
 
mk/rte.sdkbuild.mk +5 -5
index 85f603c..3860843 100644
@@ -76,15 +76,15 @@ clean: $(CLEANDIRS)
 $(ROOTDIRS-y):
 	@[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
 	@echo "== Build $@"
-	$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
+	$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$@ all
 	@if [ $@ = drivers -a $(CONFIG_RTE_BUILD_COMBINE_LIBS) = y ]; then \
-		$(MAKE) -f $(RTE_SDK)/lib/Makefile sharelib; \
+	$(MAKE) -f $(RTE_SDK)/lib/Makefile$(RTE_MKFILE_SUFFIX) sharelib; \
 	fi
 
 %_clean:
 	@echo "== Clean $*"
-	$(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
-		$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
+	$(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -a -d $(BUILDDIR)/$* ]; then \
+	$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$* clean ; \
 	fi
 
 RTE_MAKE_SUBTARGET ?= all
@@ -93,7 +93,7 @@ RTE_MAKE_SUBTARGET ?= all
 	@echo $(addsuffix _sub,$(FULL_DEPDIRS-$(*)))
 	@[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
 	@echo "== Build $*"
-	$(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \
+	$(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$* \
 		$(RTE_MAKE_SUBTARGET)
 
 .PHONY: all
mk/rte.sdkconfig.mk +3 -3
index f8d95b1..48d377a 100644
@@ -61,7 +61,7 @@ notemplate:
 ifeq ($(RTE_CONFIG_TEMPLATE),)
 config: notemplate
 else
-config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile
+config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)
 	$(Q)$(MAKE) depdirs
 	@echo "Configuration done"
 endif
@@ -93,9 +93,9 @@ SDK_RELPATH=$(shell $(RTE_SDK)/scripts/relpath.sh $(abspath $(RTE_SRCDIR)) \
 				$(abspath $(RTE_OUTPUT)))
 OUTPUT_RELPATH=$(shell $(RTE_SDK)/scripts/relpath.sh $(abspath $(RTE_OUTPUT)) \
 				$(abspath $(RTE_SRCDIR)))
-$(RTE_OUTPUT)/Makefile: | $(RTE_OUTPUT)
+$(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX): | $(RTE_OUTPUT)
 	$(Q)$(RTE_SDK)/scripts/gen-build-mk.sh $(SDK_RELPATH) $(OUTPUT_RELPATH) \
-		> $(RTE_OUTPUT)/Makefile
+		> $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)
 
 # clean installed files, and generate a new config header file
 # if NODOTCONF variable is defined, don't try to rebuild .config
mk/rte.sdkdepdirs.mk +5 -5
index bebaf2a..06c49fc 100644
@@ -32,7 +32,7 @@
 ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
   $(error "need a make config first")
 endif
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
   $(error "need a make config first")
 endif
 
@@ -43,9 +43,9 @@ depdirs: $(RTE_OUTPUT)/.depdirs
 $(RTE_OUTPUT)/.depdirs: $(RTE_OUTPUT)/.config
 	@rm -f $(RTE_OUTPUT)/.depdirs ; \
 	for d in $(ROOTDIRS-y); do \
-		if [ -f $(RTE_SRCDIR)/$$d/Makefile ]; then \
+		if [ -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
 			[ -d $(BUILDDIR)/$$d ] || mkdir -p $(BUILDDIR)/$$d ; \
-			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile depdirs \
+			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depdirs \
 				>> $(RTE_OUTPUT)/.depdirs ; \
 		fi ; \
 	done
@@ -57,8 +57,8 @@ depgraph:
 	echo "    node [color=lightblue2, style=filled];" ; \
 	for d in $(ROOTDIRS-y); do \
 		echo "    \"root\" -> \"$$d\"" ; \
-		if [ -f $(RTE_SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile depgraph ; \
+		if [ -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depgraph ; \
 		fi ; \
 	done ; \
 	echo "}"
mk/rte.sdkgcov.mk +1 -1
index fd20fd7..42e4445 100644
@@ -40,7 +40,7 @@ ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
 else
   include $(RTE_SDK)/mk/rte.vars.mk
 endif
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
   $(error "need a make config first")
 endif
 
mk/rte.sdktest.mk +1 -1
index ee25f28..932e853 100644
@@ -34,7 +34,7 @@ ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
 else
   include $(RTE_SDK)/mk/rte.vars.mk
 endif
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
   $(error "need a make config first")
 endif
 
mk/rte.subdir.mk +7 -7
index 256e64e..999585e 100644
@@ -60,15 +60,15 @@ build: _postbuild
 $(DIRS-y):
 	@[ -d $(CURDIR)/$@ ] || mkdir -p $(CURDIR)/$@
 	@echo "== Build $S/$@"
-	@$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile -C $(CURDIR)/$@ all
+	@$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile$(RTE_MKFILE_SUFFIX) -C $(CURDIR)/$@ all
 
 .PHONY: clean
 clean: _postclean
 
 %_clean:
 	@echo "== Clean $S/$*"
-	@if [ -f $(SRCDIR)/$*/Makefile -a -d $(CURDIR)/$* ]; then \
-		$(MAKE) S=$S/$* -f $(SRCDIR)/$*/Makefile -C $(CURDIR)/$* clean ; \
+	@if [ -f $(SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -a -d $(CURDIR)/$* ]; then \
+	$(MAKE) S=$S/$* -f $(SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(CURDIR)/$* clean ; \
 	fi
 	@rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
 
@@ -90,8 +90,8 @@ $(foreach d,$(DIRS-y),$(eval $(call depdirs_rule,$(d))))
 .PHONY: depdirs
 depdirs:
 	@for d in $(DIRS-y); do \
-		if [ -f $(SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depdirs ; \
+	if [ -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+		$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depdirs ; \
 		fi ; \
 	done
 
@@ -99,8 +99,8 @@ depdirs:
 depgraph:
 	@for d in $(DIRS-y); do \
 		echo "    \"$(S)\" -> \"$(S)/$$d\"" ; \
-		if [ -f $(SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depgraph ; \
+		if [ -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depgraph ; \
 		fi ; \
 	done
 
Signature · 1 line
2.7.0
#1 lore raw
Quoted 11 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Ping, does this patch reasonable and does anyone have any objections or comments?

Quoted 255 lines

---

mk/internal/rte.extvars.mk |  2 +-
mk/rte.bsdmodule.mk        |  6 +++---
mk/rte.extsubdir.mk        |  2 +-
mk/rte.module.mk           |  6 +++---
mk/rte.sdkbuild.mk         | 10 +++++-----
mk/rte.sdkconfig.mk        |  6 +++---
mk/rte.sdkdepdirs.mk       | 10 +++++-----
mk/rte.sdkgcov.mk          |  2 +-
mk/rte.sdktest.mk          |  2 +-
mk/rte.subdir.mk           | 14 +++++++-------
10 files changed, 30 insertions(+), 30 deletions(-)
mk/internal/rte.extvars.mk +0 -0
index 040d39f..3361551 100644
@@ -48,7 +48,7 @@ ifeq ("$(origin M)", "command line")
 RTE_EXTMK := $(abspath $(M))

endif
endif

mk/internal/rte.extvars.mk +1 -1
-RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
+RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX)

export RTE_EXTMK

# RTE_SDK_BIN must point to .config, include/ and lib/.

mk/rte.bsdmodule.mk +1 -1
index 86b92ff..e8a504a 100644
@@ -80,7 +80,7 @@ build: _postbuild
 
 # build module
 $(MODULE).ko: $(SRCS_LINKS)
-	$(Q)if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	$(Q)if [ ! -f $(notdir Makefile)$(RTE_MKFILE_SUFFIX) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	$(Q)if [ ! -f $(notdir BSDmakefile) ]; then ln -nfs $(SRCDIR)/BSDmakefile . ; fi
 	$(Q)MAKEFLAGS= $(BSDMAKE)
 
@@ -100,11 +100,11 @@ clean: _postclean
 # do a make clean and remove links

.PHONY: doclean
doclean:

mk/rte.bsdmodule.mk +1 -1
-	$(Q)if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	$(Q)if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
	$(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) clean
	$(Q)$(foreach FILE,$(SRCS-y) $(SRCS-n) $(SRCS-),\
		if [ -h $(notdir $(FILE)) ]; then rm -f $(notdir $(FILE)) ; fi ;)
mk/rte.bsdmodule.mk +1 -1
-	$(Q)if [ -h $(notdir Makefile) ]; then rm -f $(notdir Makefile) ; fi
+	$(Q)if [ -h $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then rm -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ; fi
	$(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS) \
		$(INSTALL-FILES-all)
mk/rte.extsubdir.mk +0 -0
index f50f006..55d4e16 100644
@@ -45,7 +45,7 @@ clean: $(DIRS-y)

$(DIRS-y):

	@echo "== $@"
	$(Q)$(MAKE) -C $(@) \
mk/rte.extsubdir.mk +1 -1
-		M=$(CURDIR)/$(@)/Makefile \
+		M=$(CURDIR)/$(@)/Makefile$(RTE_MKFILE_SUFFIX) \
		O=$(BASE_OUTPUT)/$(CUR_SUBDIR)/$(@)/$(RTE_TARGET) \
		BASE_OUTPUT=$(BASE_OUTPUT) \
		CUR_SUBDIR=$(CUR_SUBDIR)/$(@) \
mk/rte.module.mk +1 -1
index 53ed4fe..6477bbe 100644
@@ -76,7 +76,7 @@ build: _postbuild
 
 # build module
 $(MODULE).ko: $(SRCS_LINKS)
-	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	@if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
 	@$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \
 		CC="$(KERNELCC)" CROSS_COMPILE=$(CROSS) V=$(if $V,1,0)
 
@@ -97,11 +97,11 @@ clean: _postclean
 # do a make clean and remove links

.PHONY: doclean
doclean:

mk/rte.module.mk +1 -1
-	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
+	@if [ ! -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then ln -nfs $(SRCDIR)/Makefile$(RTE_MKFILE_SUFFIX) . ; fi
	$(Q)$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) clean
	@$(foreach FILE,$(SRCS-y) $(SRCS-n) $(SRCS-),\
		if [ -h $(notdir $(FILE)) ]; then rm -f $(notdir $(FILE)) ; fi ;)
mk/rte.module.mk +1 -1
-	@if [ -h $(notdir Makefile) ]; then rm -f $(notdir Makefile) ; fi
+	@if [ -h $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ]; then rm -f $(notdir Makefile$(RTE_MKFILE_SUFFIX)) ; fi
	@rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS) \
		$(INSTALL-FILES-all)
mk/rte.sdkbuild.mk +0 -0
index 85f603c..3860843 100644
@@ -76,15 +76,15 @@ clean: $(CLEANDIRS)

$(ROOTDIRS-y):

	@[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
	@echo "== Build $@"
mk/rte.sdkbuild.mk +1 -1
-	$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
+	$(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$@ all
	@if [ $@ = drivers -a $(CONFIG_RTE_BUILD_COMBINE_LIBS) = y ]; then \
mk/rte.sdkbuild.mk +1 -1
-		$(MAKE) -f $(RTE_SDK)/lib/Makefile sharelib; \
+	$(MAKE) -f $(RTE_SDK)/lib/Makefile$(RTE_MKFILE_SUFFIX) sharelib; \

fi

%_clean:

	@echo "== Clean $*"
mk/rte.sdkbuild.mk +2 -2
-	$(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
-		$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
+	$(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -a -d $(BUILDDIR)/$* ]; then \
+	$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$* clean ; \

fi

RTE_MAKE_SUBTARGET ?= all

mk/rte.sdkbuild.mk +1 -1
@@ -93,7 +93,7 @@ RTE_MAKE_SUBTARGET ?= all
 	@echo $(addsuffix _sub,$(FULL_DEPDIRS-$(*)))
 	@[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
 	@echo "== Build $*"
-	$(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \
+	$(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(BUILDDIR)/$* \
 		$(RTE_MAKE_SUBTARGET)
 

.PHONY: all

mk/rte.sdkconfig.mk +0 -0
index f8d95b1..48d377a 100644
@@ -61,7 +61,7 @@ notemplate:
 ifeq ($(RTE_CONFIG_TEMPLATE),)

config: notemplate
else

mk/rte.sdkconfig.mk +1 -1
-config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile
+config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)
	$(Q)$(MAKE) depdirs
	@echo "Configuration done"

endif

mk/rte.sdkconfig.mk +2 -2
@@ -93,9 +93,9 @@ SDK_RELPATH=$(shell $(RTE_SDK)/scripts/relpath.sh $(abspath $(RTE_SRCDIR)) \
 				$(abspath $(RTE_OUTPUT)))
 OUTPUT_RELPATH=$(shell $(RTE_SDK)/scripts/relpath.sh $(abspath $(RTE_OUTPUT)) \
 				$(abspath $(RTE_SRCDIR)))
-$(RTE_OUTPUT)/Makefile: | $(RTE_OUTPUT)
+$(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX): | $(RTE_OUTPUT)
 	$(Q)$(RTE_SDK)/scripts/gen-build-mk.sh $(SDK_RELPATH) $(OUTPUT_RELPATH) \
-		> $(RTE_OUTPUT)/Makefile
+		> $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)
 
 # clean installed files, and generate a new config header file
 # if NODOTCONF variable is defined, don't try to rebuild .config
mk/rte.sdkdepdirs.mk +0 -0
index bebaf2a..06c49fc 100644
@@ -32,7 +32,7 @@
 ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
  $(error "need a make config first")

endif

mk/rte.sdkdepdirs.mk +1 -1
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
  $(error "need a make config first")

endif

mk/rte.sdkdepdirs.mk +0 -0
@@ -43,9 +43,9 @@ depdirs: $(RTE_OUTPUT)/.depdirs

$(RTE_OUTPUT)/.depdirs: $(RTE_OUTPUT)/.config

	@rm -f $(RTE_OUTPUT)/.depdirs ; \
	for d in $(ROOTDIRS-y); do \
mk/rte.sdkdepdirs.mk +1 -1
-		if [ -f $(RTE_SRCDIR)/$$d/Makefile ]; then \
+		if [ -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
			[ -d $(BUILDDIR)/$$d ] || mkdir -p $(BUILDDIR)/$$d ; \
mk/rte.sdkdepdirs.mk +1 -1
-			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile depdirs \
+			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depdirs \
				>> $(RTE_OUTPUT)/.depdirs ; \
		fi ; \
	done
mk/rte.sdkdepdirs.mk +2 -2
@@ -57,8 +57,8 @@ depgraph:
 	echo "    node [color=lightblue2, style=filled];" ; \
 	for d in $(ROOTDIRS-y); do \
 		echo "    \"root\" -> \"$$d\"" ; \
-		if [ -f $(RTE_SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile depgraph ; \
+		if [ -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+			$(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depgraph ; \
 		fi ; \
 	done ; \
 	echo "}"
mk/rte.sdkgcov.mk +0 -0
index fd20fd7..42e4445 100644
@@ -40,7 +40,7 @@ ifeq (,$(wildcard $(RTE_OUTPUT)/.config))

else
include $(RTE_SDK)/mk/rte.vars.mk
endif

mk/rte.sdkgcov.mk +1 -1
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
  $(error "need a make config first")

endif

mk/rte.sdktest.mk +0 -0
index ee25f28..932e853 100644
@@ -34,7 +34,7 @@ ifeq (,$(wildcard $(RTE_OUTPUT)/.config))

else
include $(RTE_SDK)/mk/rte.vars.mk
endif

mk/rte.sdktest.mk +1 -1
-ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
+ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile$(RTE_MKFILE_SUFFIX)))
  $(error "need a make config first")

endif

mk/rte.subdir.mk +0 -0
index 256e64e..999585e 100644
@@ -60,15 +60,15 @@ build: _postbuild

$(DIRS-y):

	@[ -d $(CURDIR)/$@ ] || mkdir -p $(CURDIR)/$@
	@echo "== Build $S/$@"
mk/rte.subdir.mk +1 -1
-	@$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile -C $(CURDIR)/$@ all
+	@$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile$(RTE_MKFILE_SUFFIX) -C $(CURDIR)/$@ all

.PHONY: clean
clean: _postclean

%_clean:

	@echo "== Clean $S/$*"
mk/rte.subdir.mk +2 -2
-	@if [ -f $(SRCDIR)/$*/Makefile -a -d $(CURDIR)/$* ]; then \
-		$(MAKE) S=$S/$* -f $(SRCDIR)/$*/Makefile -C $(CURDIR)/$* clean ; \
+	@if [ -f $(SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -a -d $(CURDIR)/$* ]; then \
+	$(MAKE) S=$S/$* -f $(SRCDIR)/$*/Makefile$(RTE_MKFILE_SUFFIX) -C $(CURDIR)/$* clean ; \
	fi
	@rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
mk/rte.subdir.mk +0 -0
@@ -90,8 +90,8 @@ $(foreach d,$(DIRS-y),$(eval $(call depdirs_rule,$(d))))

.PHONY: depdirs
depdirs:

	@for d in $(DIRS-y); do \
mk/rte.subdir.mk +2 -2
-		if [ -f $(SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depdirs ; \
+	if [ -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+		$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depdirs ; \
		fi ; \
	done
mk/rte.subdir.mk +0 -0
@@ -99,8 +99,8 @@ depdirs:

depgraph:

	@for d in $(DIRS-y); do \
		echo "    \"$(S)\" -> \"$(S)/$$d\"" ; \
mk/rte.subdir.mk +2 -2
-		if [ -f $(SRCDIR)/$$d/Makefile ]; then \
-			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depgraph ; \
+		if [ -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) ]; then \
+			$(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile$(RTE_MKFILE_SUFFIX) depgraph ; \
Quoted 7 lines
		fi ; \
	done
Signature · 1 line
2.7.0

Regards,
Keith

#2 lore raw
In reply to Keith Wiles

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 9 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

#3 lore raw
Quoted 10 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 7 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

Quoted 6 lines
Quoted 2 lines

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Quoted 1 line

Regards,
Keith

#4 lore raw

2016-02-28 21:47, Wiles, Keith:

Quoted 13 lines
Quoted 13 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 9 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Quoted 7 lines
Quoted 3 lines

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Why would you like to have another project inside the DPDK files tree? If you want to integrate the lib inside an existing project, the solution is pkgconfig.

#5 lore raw
Quoted 18 lines

2016-02-28 21:47, Wiles, Keith:

Quoted 17 lines
Quoted 16 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 9 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

Quoted 7 lines
Quoted 3 lines

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Why would you like to have another project inside the DPDK files tree? If you want to integrate the lib inside an existing project, the solution is pkgconfig.

The goal for me was to use DPDK build system for that project, instead of using autotools or some other makefile system. In the case of FreeBSD code, the FreeBSD build system requires FreeBSD tools to be built as the ‘make’ and the Makefiles are very different on a Linux machine.

Quoted 1 line

Regards,
Keith

#6 lore raw
Quoted 20 lines
Quoted 20 lines

2016-02-28 21:47, Wiles, Keith:

Quoted 19 lines
Quoted 10 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 7 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

Quoted 6 lines
Quoted 2 lines

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Why would you like to have another project inside the DPDK files tree? If you want to integrate the lib inside an existing project, the solution is pkgconfig.

The goal for me was to use DPDK build system for that project, instead of using autotools or some other makefile system. In the case of FreeBSD code, the FreeBSD build system requires FreeBSD tools to be built as the ‘make’ and the Makefiles are very different on a Linux machine.

Does anyone find this patch useful, I would hate to see this one die as it does not effect the current builds, but adds support for using DPDK build system without having to modify or move the existing Makefiles.

Thanks
++Keith

Quoted 10 lines
Quoted 1 line

Regards,
Keith

Regards,
Keith

#7 lore raw

2016-03-03 14:55, Wiles, Keith:

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines

2016-02-28 21:47, Wiles, Keith:

Quoted 20 lines
Quoted 10 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 7 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

Quoted 6 lines
Quoted 2 lines

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Why would you like to have another project inside the DPDK files tree? If you want to integrate the lib inside an existing project, the solution is pkgconfig.

The goal for me was to use DPDK build system for that project, instead of using autotools or some other makefile system. In the case of FreeBSD code, the FreeBSD build system requires FreeBSD tools to be built as the ‘make’ and the Makefiles are very different on a Linux machine.

Does anyone find this patch useful, I would hate to see this one die as it does not effect the current builds, but adds support for using DPDK build system without having to modify or move the existing Makefiles.

I would hate making the build system even more complicated to use it for something which is not its role.
It opens the door to feature requests which are clearly out of its scope.

#8 lore raw
Quoted 27 lines

2016-03-03 14:55, Wiles, Keith:

Quoted 26 lines
Quoted 26 lines
Quoted 25 lines

2016-02-28 21:47, Wiles, Keith:

Quoted 13 lines
Quoted 13 lines

Hi,

2016-02-09 11:35, Keith Wiles:

Quoted 9 lines

Adding support to the build system to allow for Makefile.XXX extention to a subtree, which already has Makefiles. These Makefiles could be from the autotools and others places. Using the Makefile extention RTE_MKFILE_SUFFIX in a makefile subtree using 'export RTE_MKFILE_SUFFIX=.XXX' to use Makefile.XXX in that subtree.

The main reason I needed this feature was to integrate a autotool open source projects with DPDK and keep the original Makefiles.

Quoted 7 lines
Quoted 3 lines

Sorry I fail to understand why it is needed.
Are you trying to add autotool in DPDK? I don't think it is a good approach. The DPDK must provide a pkgconfig interface to be integrated anywhere.

I was not trying to add autotools to DPDK. On a number of times I wanted to integrate a open source project(s) with DPDK and use DPDK’s build system, but because the open source project already contained Makefile files you can not use DPDK build system without modify or moving the original Makefile files. Using this method I can just add a exported variable and supply my own Makefile.XXX files.

One case was building FreeBSD source, but I did not want to modify FreeBSD Makefiles (or reply on previous built Makefiles as they would not work on Linux anyway) as I was pulling the source down from freebsd.org repo. Using a patch to add the Makefiles with a different suffix allows me to build FreeBSD using DPDK, without having to modify or own the FreeBSD source. I have had this problem a number of times with open source code I did not want to modify, but just build within DPDK build system and adding the support for a different suffix to DPDK provided a clean way. The change does not effect the correct build system and just allows someone to define a new suffix for a given subtree in the code.

Why would you like to have another project inside the DPDK files tree? If you want to integrate the lib inside an existing project, the solution is pkgconfig.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

The goal for me was to use DPDK build system for that project, instead of using autotools or some other makefile system. In the case of FreeBSD code, the FreeBSD build system requires FreeBSD tools to be built as the ‘make’ and the Makefiles are very different on a Linux machine.

Does anyone find this patch useful, I would hate to see this one die as it does not effect the current builds, but adds support for using DPDK build system without having to modify or move the existing Makefiles.

I would hate making the build system even more complicated to use it for something which is not its role.
It opens the door to feature requests which are clearly out of its scope.

Ok, Thanks I will change the status in patchwork to rejected.

Quoted 2 lines

Regards,
Keith