Skip to contentSkip to conversation

Consolidate offset header rules

PATCH New Brian Gerst 1 participant 1 message Sep 28, 2003

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Consolidate offset header rules

Move the rules to generate the offset header file to the main Makefile.

--
Brian Gerst

arch/alpha/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/alpha/Makefile linux/arch/alpha/Makefile
@@ -112,19 +112,11 @@
 	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $(boot)/$@
 
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+OFFSETS := include/asm-$(ARCH)/asm_offsets.h
 
 archclean:
 	$(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
 
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
 define archhelp
   echo '* boot		- Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
   echo '  bootimage	- SRM bootable image (arch/alpha/boot/bootimage)'
arch/arm/Makefile +4 -7
diff -urN linux-2.6.0-test6/arch/arm/Makefile linux/arch/arm/Makefile
@@ -140,9 +140,11 @@
 
 prepare: maketools
 
+OFFSETS := include/asm-$(ARCH)/constants.h
+
 .PHONY: maketools FORCE
 maketools: include/asm-arm/.arch \
-	   include/asm-arm/constants.h include/linux/version.h FORCE
+	   $(OFFSETS) include/linux/version.h FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
 
 # Convert bzImage to zImage
@@ -171,12 +173,7 @@
 i:;	$(Q)$(MAKE) $(build)=$(boot) install
 zi:;	$(Q)$(MAKE) $(build)=$(boot) zinstall
 
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/asm-arm/.arch \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+arch/$(ARCH)/kernel/asm-offsets.s: include/asm-arm/.arch
 
 define archhelp
   echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
arch/arm26/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/arm26/Makefile linux/arch/arm26/Makefile
@@ -56,9 +56,7 @@
 
 boot := arch/arm26/boot
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
+OFFSETS := include/asm-$(ARCH)/asm_offsets.h
 
 .PHONY: maketools FORCE
 maketools: FORCE
@@ -101,12 +99,6 @@
 	fi; \
 	)
 
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
 define archhelp
   echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
   echo  '  Image         - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
arch/cris/Makefile +3 -8
diff -urN linux-2.6.0-test6/arch/cris/Makefile linux/arch/cris/Makefile
@@ -85,8 +85,9 @@
 	rm -f timage vmlinux.bin cramfs.img
 	rm -rf $(LD_SCRIPT).tmp
 
-prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
-	 include/asm-$(ARCH)/$(SARCH)/offset.h
+prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch
+
+OFFSETS := include/asm-$(ARCH)/$(SARCH)/offset.h
 
 # Create some links to make all tools happy
 arch/$(ARCH)/.links:
@@ -102,9 +103,3 @@
 	@rm -f include/asm-$(ARCH)/arch
 	@ln -sf $(SARCH) include/asm-$(ARCH)/arch
 	@touch $@
-
-arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-					include/config/MARKER
-
-include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
arch/h8300/Makefile +4 -6
diff -urN linux-2.6.0-test6/arch/h8300/Makefile linux/arch/h8300/Makefile
@@ -62,17 +62,15 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/machine-depend.h include/asm-$(ARCH)/asm-offsets.h
+prepare: include/asm-$(ARCH)/machine-depend.h 
+
+OFFSETS := include/asm-$(ARCH)/asm-offsets.h
 
 include/asm-$(ARCH)/machine-depend.h: include/asm-$(ARCH)/$(BOARD)/machine-depend.h
 	$(Q)ln -sf $(BOARD)/machine-depend.h \
                    include/asm-$(ARCH)/machine-depend.h
 	@echo '  Create include/asm-$(ARCH)/machine-depend.h'
 
-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
-				   include/asm include/linux/version.h
-	$(call filechk,gen-asm-offsets)
-
 vmlinux.srec vmlinux.bin: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
@@ -81,4 +79,4 @@
   echo  'vmlinux.srec - Create srec binary'
 endef
 
-CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h include/asm-$(ARCH)/machine-depend.h
+CLEAN_FILES += include/asm-$(ARCH)/machine-depend.h
arch/i386/Makefile +1 -8
diff -urN linux-2.6.0-test6/arch/i386/Makefile linux/arch/i386/Makefile
@@ -123,14 +123,7 @@
 install fdimage fdimage144 fdimage288: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+OFFSETS := include/asm-$(ARCH)/asm_offsets.h
 
 archclean:
 	$(Q)$(MAKE) $(clean)=arch/i386/boot
arch/ia64/Makefile +4 -7
diff -urN linux-2.6.0-test6/arch/ia64/Makefile linux/arch/ia64/Makefile
@@ -84,18 +84,15 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-CLEAN_FILES += include/asm-ia64/.offsets.h.stamp include/asm-ia64/offsets.h vmlinux.gz bootloader
+CLEAN_FILES += include/asm-ia64/.offsets.h.stamp vmlinux.gz bootloader
 
-prepare: include/asm-ia64/offsets.h
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+OFFSETS := include/asm-ia64/offsets.h
 
 arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp
 
 include/asm-ia64/.offsets.h.stamp:
-	[ -s include/asm-ia64/offsets.h ] \
-	 || echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/offsets.h
+	[ -s $(OFFSETS) ] \
+	 || echo "#define IA64_TASK_SIZE 0" > $(OFFSETS)
 	touch $@
 
 boot:	lib/lib.a vmlinux
arch/m68knommu/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/m68knommu/Makefile linux/arch/m68knommu/Makefile
@@ -87,21 +87,13 @@
 
 head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
 
-CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \
-	       arch/$(ARCH)/kernel/asm-offsets.s
-
 core-y	+= arch/m68knommu/kernel/ \
 	   arch/m68knommu/mm/ \
 	   $(CLASSDIR) \
 	   arch/m68knommu/platform/$(PLATFORM)/
 libs-y	+= arch/m68knommu/lib/
 
-prepare: include/asm-$(ARCH)/asm-offsets.h
+OFFSETS := include/asm-$(ARCH)/asm-offsets.h
 
 archclean:
 	$(call descend arch/$(ARCH)/boot, subdirclean)
-
-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
-				   include/asm include/linux/version.h \
-				   include/config/MARKER
-	$(call filechk,gen-asm-offsets)
arch/parisc/Makefile +2 -8
diff -urN linux-2.6.0-test6/arch/parisc/Makefile linux/arch/parisc/Makefile
@@ -85,15 +85,9 @@
 # Shorthands for known targets not supported by parisc, use palo as default
 Image zImage bzImage: palo
 
-prepare: include/asm-parisc/offsets.h
+OFFSETS := include/asm-parisc/offsets.h
 
-arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES	+= lifimage include/asm-parisc/offsets.h
+CLEAN_FILES	+= lifimage
 MRPROPER_FILES	+= palo.conf
 
 define archhelp
arch/ppc/Makefile +2 -9
diff -urN linux-2.6.0-test6/arch/ppc/Makefile linux/arch/ppc/Makefile
@@ -71,13 +71,9 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=arch/ppc/boot
 
-prepare: include/asm-$(ARCH)/offsets.h checkbin
+prepare: checkbin
 
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+OFFSETS := include/asm-$(ARCH)/offsets.h
 
 ifdef CONFIG_6xx
 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
@@ -97,6 +93,3 @@
 checkbin:
 	@true
 endif
-
-CLEAN_FILES +=	include/asm-$(ARCH)/offsets.h \
-		arch/$(ARCH)/kernel/asm-offsets.s
arch/ppc64/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/ppc64/Makefile linux/arch/ppc64/Makefile
@@ -50,12 +50,4 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-ppc64/offsets.h
-
-arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-ppc64/offsets.h
+OFFSETS := include/asm-ppc64/offsets.h
arch/s390/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/s390/Makefile linux/arch/s390/Makefile
@@ -63,12 +63,4 @@
 	$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
 
 
-prepare: include/asm-$(ARCH)/offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/offsets.h
+OFFSETS := include/asm-$(ARCH)/offsets.h
arch/sparc/Makefile +1 -10
diff -urN linux-2.6.0-test6/arch/sparc/Makefile linux/arch/sparc/Makefile
@@ -62,16 +62,7 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES +=	include/asm-$(ARCH)/asm_offsets.h	\
-		arch/$(ARCH)/kernel/asm-offsets.s
+OFFSETS := include/asm-$(ARCH)/asm_offsets.h
 
 # Don't use tabs in echo arguments.
 define archhelp
arch/v850/Makefile +2 -12
diff -urN linux-2.6.0-test6/arch/v850/Makefile linux/arch/v850/Makefile
@@ -48,16 +48,6 @@
 	$(OBJCOPY) $(OBJCOPY_FLAGS_BLOB) --rename-section .data=.root,alloc,load,readonly,data,contents $< root_fs_image.o
 endif
 
+OFFSETS := include/asm-$(ARCH)/asm-consts.h
 
-prepare: include/asm-$(ARCH)/asm-consts.h
-
-# Generate constants from C code for use by asm files
-arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \
-	       arch/$(ARCH)/kernel/asm-consts.s \
-	       root_fs_image.o
+CLEAN_FILES += root_fs_image.o
arch/x86_64/Makefile +1 -9
diff -urN linux-2.6.0-test6/arch/x86_64/Makefile linux/arch/x86_64/Makefile
@@ -87,15 +87,7 @@
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/offset.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/offset.h
+OFFSETS := include/asm-$(ARCH)/offset.h
 
 define archhelp
   echo  '* bzImage	- Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
Makefile +11 -0
diff -urN linux-2.6.0-test6/Makefile linux/Makefile
@@ -718,6 +718,7 @@
 # Generate asm-offsets.h 
 # ---------------------------------------------------------------------------
 
+ifneq ($(OFFSETS),)
 define filechk_gen-asm-offsets
 	(set -e; \
 	 echo "#ifndef __ASM_OFFSETS_H__"; \
@@ -734,6 +735,16 @@
 	 echo "#endif" )
 endef
 
+prepare: $(OFFSETS)
+
+arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
+				   include/config/MARKER
+
+$(OFFSETS): arch/$(ARCH)/kernel/asm-offsets.s
+	$(call filechk,gen-asm-offsets)
+
+CLEAN_FILES += $(OFFSETS)
+endif
 
 ###
 # Cleaning is done on three levels.