Skip to contentSkip to conversation

kbuild: Compatible with old bash, fix help, make clean fix

PATCH Sam Ravnborg 2 participants 3 messages Nov 3, 2002 Kbuild

lore
Share & tools
lore
#0 lore raw

kbuild fixes:
o Do not use "-" in exported symbols, bash does not support that (Keith)
o Sort ALL_SUBDIRS, to avoid warning about duplicate target
- Happens when the same directory are specified with drivers-y and drivers-n
o Added AWK, a few architectures actually use awk for normal compilation
o Removed distclean from make help, now that distclean and mrporper are merged

Sam

The following files are touched:

 Makefile               |   17 +++++++++--------
 scripts/Makefile.build |    2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

===== Makefile 1.338 vs edited =====

Makefile +9 -8
@@ -155,6 +155,7 @@
 STRIP		= $(CROSS_COMPILE)strip
 OBJCOPY		= $(CROSS_COMPILE)objcopy
 OBJDUMP		= $(CROSS_COMPILE)objdump
+AWK		= awk
 GENKSYMS	= /sbin/genksyms
 DEPMOD		= /sbin/depmod
 KALLSYMS	= /sbin/kallsyms
@@ -214,7 +215,7 @@
 
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 
-export include-config := 1
+export include_config := 1
 
 -include .config
 
@@ -228,9 +229,10 @@
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
 		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
 
-ALL_SUBDIRS     := $(SUBDIRS) $(patsubst %/,%,$(filter %/, $(init-n) $(init-) \
+ALL_SUBDIRS     := $(sort $(SUBDIRS) $(patsubst %/,%,$(filter %/, \
+		     $(init-n) $(init-) \
 		     $(core-n) $(core-) $(drivers-n) $(drivers-) \
-		     $(net-n) $(net-) $(libs-n) $(libs-)))
+		     $(net-n)  $(net-)  $(libs-n)    $(libs-))))
 
 init-y		:= $(patsubst %/, %/built-in.o, $(init-y))
 core-y		:= $(patsubst %/, %/built-in.o, $(core-y))
@@ -238,7 +240,7 @@
 net-y		:= $(patsubst %/, %/built-in.o, $(net-y))
 libs-y		:= $(patsubst %/, %/lib.a, $(libs-y))
 
-ifdef include-config
+ifdef include_config
 
 # Here goes the main Makefile
 # ===========================================================================
@@ -602,7 +604,7 @@
 	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
 	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
 
-else # ifdef include-config
+else # ifdef include_config
 
 ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
 
@@ -764,8 +766,7 @@
 help:
 	@echo  'Cleaning targets:'
 	@echo  '  clean		- remove most generated files but keep the config'
-	@echo  '  mrproper	- remove all generated files including the config'
-	@echo  '  distclean	- mrproper + remove files generated by editors and patch'
+	@echo  '  mrproper	- remove all generated files + config + various backup files'
 	@echo  ''
 	@echo  'Configuration targets:'
 	@echo  '  oldconfig	- Update current config utilising a line-oriented program'
@@ -828,7 +829,7 @@
 	$(MAKE) $@
 
 endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
-endif # ifdef include-config
+endif # ifdef include_config
 
 # FIXME Should go into a make.lib or something 
 # ===========================================================================

===== scripts/Makefile.build 1.7 vs edited =====

scripts/Makefile.build +1 -1
@@ -7,7 +7,7 @@
 .PHONY: __build
 __build:
 
-ifdef include-config
+ifdef include_config
 include .config
 endif
 
#1 lore raw
Quoted 1 line · Sam Ravnborg

o Added AWK, a few architectures actually use awk for normal compilation

Needs to be exported as well.
- CPP AR NM STRIP OBJCOPY OBJDUMP MAKE GENKSYMS PERL UTS_MACHINE \
+ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE GENKSYMS PERL AWK UTS_MACHINE \

#2 lore raw
In reply to Sam Ravnborg

AWK exported now, as pointed out by Keith.

kbuild fixes:
o Do not use "-" in exported symbols, bash does not support that (Matthew/Keith)
o Sort ALL_SUBDIRS, to avoid warning about duplicate target
- Happens when the same directory are specified with drivers-y and drivers-n
o Added AWK, a few architectures actually use awk for normal compilation
o Removed distclean from make help, now that distclean and mrporper are merged

Sam

Touches these files:

 Makefile               |   19 ++++++++++---------
 scripts/Makefile.build |    2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

===== Makefile 1.338 vs edited =====

Makefile +10 -9
@@ -155,6 +155,7 @@
 STRIP		= $(CROSS_COMPILE)strip
 OBJCOPY		= $(CROSS_COMPILE)objcopy
 OBJDUMP		= $(CROSS_COMPILE)objdump
+AWK		= awk
 GENKSYMS	= /sbin/genksyms
 DEPMOD		= /sbin/depmod
 KALLSYMS	= /sbin/kallsyms
@@ -173,7 +174,7 @@
 
 export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
 	CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
-	CPP AR NM STRIP OBJCOPY OBJDUMP MAKE GENKSYMS PERL UTS_MACHINE \
+	CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
 	HOSTCXX HOSTCXXFLAGS
 
 export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
@@ -214,7 +215,7 @@
 
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 
-export include-config := 1
+export include_config := 1
 
 -include .config
 
@@ -228,9 +229,10 @@
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
 		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
 
-ALL_SUBDIRS     := $(SUBDIRS) $(patsubst %/,%,$(filter %/, $(init-n) $(init-) \
+ALL_SUBDIRS     := $(sort $(SUBDIRS) $(patsubst %/,%,$(filter %/, \
+		     $(init-n) $(init-) \
 		     $(core-n) $(core-) $(drivers-n) $(drivers-) \
-		     $(net-n) $(net-) $(libs-n) $(libs-)))
+		     $(net-n)  $(net-)  $(libs-n)    $(libs-))))
 
 init-y		:= $(patsubst %/, %/built-in.o, $(init-y))
 core-y		:= $(patsubst %/, %/built-in.o, $(core-y))
@@ -238,7 +240,7 @@
 net-y		:= $(patsubst %/, %/built-in.o, $(net-y))
 libs-y		:= $(patsubst %/, %/lib.a, $(libs-y))
 
-ifdef include-config
+ifdef include_config
 
 # Here goes the main Makefile
 # ===========================================================================
@@ -602,7 +604,7 @@
 	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
 	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
 
-else # ifdef include-config
+else # ifdef include_config
 
 ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
 
@@ -764,8 +766,7 @@
 help:
 	@echo  'Cleaning targets:'
 	@echo  '  clean		- remove most generated files but keep the config'
-	@echo  '  mrproper	- remove all generated files including the config'
-	@echo  '  distclean	- mrproper + remove files generated by editors and patch'
+	@echo  '  mrproper	- remove all generated files + config + various backup files'
 	@echo  ''
 	@echo  'Configuration targets:'
 	@echo  '  oldconfig	- Update current config utilising a line-oriented program'
@@ -828,7 +829,7 @@
 	$(MAKE) $@
 
 endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
-endif # ifdef include-config
+endif # ifdef include_config
 
 # FIXME Should go into a make.lib or something 
 # ===========================================================================

===== scripts/Makefile.build 1.7 vs edited =====

scripts/Makefile.build +1 -1
@@ -7,7 +7,7 @@
 .PHONY: __build
 __build:
 
-ifdef include-config
+ifdef include_config
 include .config
 endif