Re: [Linux-ia64] ia64 arch makefile update

From: Sam Ravnborg <sam_at_ravnborg.org>
Date: 2002-12-08 09:01:45
Second try ready.
Other architectures does not practice this, but I added a rule to
copy vmlinux.gz + bootloader to root of kernel-tree.

bootloader is build when needed, therefore the boot: target has not been
re-introduced.

Complete summary of changes:
o Copy vmlinux-gz + bootloader to root of kernel-tree
o Fix "make clean"
o Delete vmlinux.gz + bootloader during make clean
> o Simplified arch/ia64/Makefile
>   - During this process the boot: target were removed
> o Moved final generation of vmlinux.gz to boot/Makefile
>   - This allowed me to use some of the kbuild infrastructure
>   - Final file "vmlinux.gz" is now saved in arch/ia64/boot in line with
>     other architectures.
> o s/$(ARCH)/ia64 - since we know that this is the architecture we use
> o Small clean up all over, e.g. removed inclusion of Rules.make
>   Also made some nicer indenting, but no functional changes.

I had to modify a few files to build the kernel, but they did not
have anything to do with the Makefiles.

Any feedback appreciated,
	Sam

 Makefile             |   77 ++++++++++++++++++++++----------------------------  boot/Makefile        |   33 ++++++++++++++-------
 dig/Makefile         |    2 -
 hp/common/Makefile   |    2 -
 hp/sim/Makefile      |    2 -
 hp/zx1/Makefile      |    2 -
 ia32/Makefile        |    6 +--
 kernel/Makefile      |    9 +++--
 mm/Makefile          |   12 +------
 pci/Makefile         |    5 +--
 sn/fakeprom/Makefile |    4 --
 11 files changed, 69 insertions(+), 85 deletions(-)

===== arch/ia64/Makefile 1.27 vs edited =====
--- 1.27/arch/ia64/Makefile	Fri Oct 25 06:35:08 2002
+++ edited/arch/ia64/Makefile	Sat Dec  7 23:00:32 2002
@@ -9,16 +9,15 @@
 #
 
 NM := $(CROSS_COMPILE)nm -B
-AWK := awk
 
 export AWK
 
-OBJCOPYFLAGS := --strip-all
-LDFLAGS_vmlinux := -static
-AFLAGS_KERNEL := -mconstant-gp
-EXTRA	=
+OBJCOPYFLAGS	:= --strip-all
+LDFLAGS_vmlinux	:= -static
+AFLAGS_KERNEL	:= -mconstant-gp
+EXTRA		:=
 
-CFLAGS := $(CFLAGS) -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
+cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
 	  -falign-functions=32
 # -ffunction-sections
 CFLAGS_KERNEL := -mconstant-gp
@@ -29,52 +28,43 @@
 	CFLAGS += -frename-registers --param max-inline-insns=5000
 endif
 
-ifeq ($(CONFIG_ITANIUM_BSTEP_SPECIFIC),y)
-	CFLAGS += -mb-step
-endif
-
-HEAD := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
+cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC)	+= -mb-step
+cflags-$(CONFIG_IA64_SGI_SN)		+= -DBRINGUP
 
-libs-y				+= arch/$(ARCH)/lib/
-core-y				+= arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
-core-$(CONFIG_IA32_SUPPORT)	+= arch/$(ARCH)/ia32/
-core-$(CONFIG_IA64_DIG) 	+= arch/$(ARCH)/dig/
-core-$(CONFIG_IA64_GENERIC) 	+= arch/$(ARCH)/dig/ arch/$(ARCH)/hp/common/ arch/$(ARCH)/hp/zx1/ \
-				   arch/$(ARCH)/hp/sim/
-core-$(CONFIG_IA64_HP_ZX1)	+= arch/$(ARCH)/dig/
-core-$(CONFIG_IA64_SGI_SN)	+= arch/$(ARCH)/sn/kernel arch/$(ARCH)/sn/io \
-				   arch/$(ARCH)/sn/fakeprom
-drivers-$(CONFIG_PCI)		+= arch/$(ARCH)/pci/
-drivers-$(CONFIG_IA64_HP_SIM)	+= arch/$(ARCH)/hp/sim/
-drivers-$(CONFIG_IA64_HP_ZX1)	+= arch/$(ARCH)/hp/common/ arch/$(ARCH)/hp/zx1/
-
-ifdef CONFIG_IA64_SGI_SN
-	CFLAGS			+= -DBRINGUP
-        SUBDIRS         	+= arch/$(ARCH)/sn/fakeprom
-endif
+HEAD := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
 
-makeboot = $(call descend,arch/ia64/boot,$(1))
-maketool = $(call descend,arch/ia64/tools,$(1))
+libs-y				+= arch/ia64/lib/
+core-y				+= arch/ia64/kernel/ arch/ia64/mm/
+core-$(CONFIG_IA32_SUPPORT)	+= arch/ia64/ia32/
+core-$(CONFIG_IA64_DIG) 	+= arch/ia64/dig/
+core-$(CONFIG_IA64_GENERIC) 	+= arch/ia64/dig/ arch/ia64/hp/common/
+core-$(CONFIG_IA64_GENERIC)	+= arch/ia64/hp/zx1/ arch/ia64/hp/sim/
+core-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/dig/
+core-$(CONFIG_IA64_SGI_SN)	+= arch/ia64/sn/kernel/ arch/ia64/sn/io/ \
+				   arch/ia64/sn/fakeprom/
+drivers-$(CONFIG_PCI)		+= arch/ia64/pci/
+drivers-$(CONFIG_IA64_HP_SIM)	+= arch/ia64/hp/sim/
+drivers-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/hp/common/ arch/ia64/hp/zx1/
+
+makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/boot $(1)
+maketool =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/tools $(1)
 
-.PHONY: compressed archclean archmrproper $(TOPDIR)/include/asm-ia64/offsets.h
+.PHONY: compressed archclean archmrproper include/asm-ia64/offsets.h
 
-all: compressed boot
+all compressed: vmlinux.gz
 
-boot: vmlinux
-	+@$(call makeboot,all)
+vmlinux.gz: vmlinux
+	$(call makeboot,vmlinux.gz)
 
-compressed: vmlinux
-	$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp
-	gzip vmlinux-tmp
-	mv vmlinux-tmp.gz vmlinux.gz
 
+archmrproper:
 archclean:
-	$(MAKE) -rR -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
+	$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/ia64/boot
 
-archmrproper:
+CLEAN_FILES += include/asm-ia64/offsets.h vmlinux.gz bootloader
 
-prepare: $(TOPDIR)/include/asm-ia64/offsets.h
+prepare: include/asm-ia64/offsets.h
 
-$(TOPDIR)/include/asm-ia64/offsets.h: include/asm include/linux/version.h \
-				      include/config/MARKER
-	+@$(call maketool,$@)
+include/asm-ia64/offsets.h: include/asm include/linux/version.h \
+			    include/config/MARKER
+	$(call maketool,$@)
===== arch/ia64/boot/Makefile 1.6 vs edited =====
--- 1.6/arch/ia64/boot/Makefile	Mon Oct 28 03:20:05 2002
+++ edited/arch/ia64/boot/Makefile	Sat Dec  7 22:49:21 2002
@@ -8,20 +8,31 @@
 # Copyright (C) 1998 by David Mosberger-Tang <davidm@hpl.hp.com>
 #
 
-LINKFLAGS = -static -T $(src)/bootloader.lds
+EXTRA_TARGETS := vmlinux.bin vmlinux.gz
 
-OBJS	= $(obj)/bootloader.o
+targets-$(CONFIG_IA64_HP_SIM)  += bootloader
+targets-$(CONFIG_IA64_GENERIC) += bootloader
+EXTRA_TARGETS += $(sort $(targets-y))
 
-targets-$(CONFIG_IA64_HP_SIM)	+= bootloader
-targets-$(CONFIG_IA64_GENERIC)	+= bootloader
+quiet_cmd_cptotop = CP      $@
+      cmd_cptotop = cp $< $@
 
-CFLAGS	:= $(CFLAGS) $(CFLAGS_KERNEL)
+vmlinux.gz: $(obj)/vmlinux.gz $(targets-y)
+	$(call cmd,cptotop)
+	@echo '  Kernel: $@ is ready'
 
-all:	$(targets-y)
+bootloader: $(obj)/bootloader
+	$(call cmd,cptotop)
 
-bootloader: $(OBJS)
-	$(LD) $(LINKFLAGS) $(OBJS) $(TOPDIR)/lib/lib.a $(TOPDIR)/arch/$(ARCH)/lib/lib.a \
-	-o bootloader
+$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
+	$(call if_changed,gzip)
 
-clean:
-	rm -f $(TARGETS)
+$(obj)/vmlinux.bin: vmlinux FORCE
+	$(call if_changed,objcopy)
+
+
+LDFLAGS_bootloader = -static -T
+
+$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o \
+                   lib/lib.a arch/ia64/lib/lib.a FORCE
+	$(call if_changed,ld)
===== arch/ia64/dig/Makefile 1.5 vs edited =====
--- 1.5/arch/ia64/dig/Makefile	Mon Sep 23 01:34:27 2002
+++ edited/arch/ia64/dig/Makefile	Fri Dec  6 22:16:01 2002
@@ -7,5 +7,3 @@
 
 obj-y := setup.o
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/hp/common/Makefile 1.4 vs edited =====
--- 1.4/arch/ia64/hp/common/Makefile	Sat Sep 21 10:25:52 2002
+++ edited/arch/ia64/hp/common/Makefile	Fri Dec  6 22:16:02 2002
@@ -8,5 +8,3 @@
 export-objs := sba_iommu.o
 
 obj-y := sba_iommu.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/hp/sim/Makefile 1.4 vs edited =====
--- 1.4/arch/ia64/hp/sim/Makefile	Mon Sep 23 01:34:28 2002
+++ edited/arch/ia64/hp/sim/Makefile	Fri Dec  6 22:16:03 2002
@@ -13,5 +13,3 @@
 obj-$(CONFIG_HP_SIMETH)	+= simeth.o
 obj-$(CONFIG_HP_SIMSERIAL) += simserial.o
 obj-$(CONFIG_HP_SIMSCSI) += simscsi.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/hp/zx1/Makefile 1.4 vs edited =====
--- 1.4/arch/ia64/hp/zx1/Makefile	Sat Sep 21 10:25:52 2002
+++ edited/arch/ia64/hp/zx1/Makefile	Fri Dec  6 22:16:04 2002
@@ -7,5 +7,3 @@
 
 obj-y := hpzx1_misc.o
 obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/ia32/Makefile 1.7 vs edited =====
--- 1.7/arch/ia64/ia32/Makefile	Mon Sep 23 01:34:28 2002
+++ edited/arch/ia64/ia32/Makefile	Fri Dec  6 22:16:04 2002
@@ -2,7 +2,5 @@
 # Makefile for the ia32 kernel emulation subsystem.
 #
 
-obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o ia32_support.o ia32_traps.o \
-	 binfmt_elf32.o ia32_ldt.o
-
-include $(TOPDIR)/Rules.make
+obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \
+	 ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
===== arch/ia64/kernel/Makefile 1.10 vs edited =====
--- 1.10/arch/ia64/kernel/Makefile	Sat Sep 21 10:25:52 2002
+++ edited/arch/ia64/kernel/Makefile	Fri Dec  6 22:16:05 2002
@@ -6,14 +6,15 @@
 
 export-objs := ia64_ksyms.o
 
-obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \
-	 machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o	\
+obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \
+	 irq.o irq_ia64.o irq_lsapic.o ivt.o \
+	 machvec.o pal.o process.o perfmon.o ptrace.o sal.o \
+	 semaphore.o setup.o	\
 	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
+
 obj-$(CONFIG_IOSAPIC) += iosapic.o
 obj-$(CONFIG_IA64_PALINFO) += palinfo.o
 obj-$(CONFIG_EFI_VARS) += efivars.o
 obj-$(CONFIG_SMP) += smp.o smpboot.o
 obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o
 obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/mm/Makefile 1.5 vs edited =====
--- 1.5/arch/ia64/mm/Makefile	Tue Oct 22 15:48:03 2002
+++ edited/arch/ia64/mm/Makefile	Fri Dec  6 22:16:05 2002
@@ -1,15 +1,9 @@
 #
 # Makefile for the ia64-specific parts of the memory manager.
 #
-# Note! Dependencies are done automagically by 'make dep', which also
-# removes any old dependencies. DON'T put your own dependencies here
-# unless it's something special (ie not a .c file).
-#
-# Note 2! The CFLAGS definition is now in the main makefile...
 
-obj-y	 := init.o fault.o tlb.o extable.o
+obj-y := init.o fault.o tlb.o extable.o
+
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
-obj-$(CONFIG_NUMA) += numa.o
+obj-$(CONFIG_NUMA)	   += numa.o
 obj-$(CONFIG_DISCONTIGMEM) += discontig.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/pci/Makefile 1.1 vs edited =====
--- 1.1/arch/ia64/pci/Makefile	Sat Sep 21 10:25:52 2002
+++ edited/arch/ia64/pci/Makefile	Fri Dec  6 22:16:06 2002
@@ -1,3 +1,4 @@
+#
+# Makefile for the ia64-specific parts of the pci bus
+#
 obj-y		:= pci.o
-
-include $(TOPDIR)/Rules.make
===== arch/ia64/sn/fakeprom/Makefile 1.8 vs edited =====
--- 1.8/arch/ia64/sn/fakeprom/Makefile	Sat Aug 17 04:50:17 2002
+++ edited/arch/ia64/sn/fakeprom/Makefile	Sat Dec  7 22:55:14 2002
@@ -18,7 +18,3 @@
 
 clean:
 	rm -f *.o fprom
-
-
-include $(TOPDIR)/Rules.make
-
Received on Sat Dec 07 14:02:31 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:11 EST