]> xenbits.xensource.com Git - people/julieng/boot-wrapper-aarch64.git/commitdiff
Allow support of multiple assembly files
authorMark Rutland <mark.rutland@arm.com>
Mon, 11 Feb 2013 14:25:33 +0000 (14:25 +0000)
committerMark Rutland <mark.rutland@arm.com>
Wed, 5 Jun 2013 12:57:42 +0000 (13:57 +0100)
To support more complex functionality, it would be nice if we could
separate bits of the boot code into separate files.

This patch refactors the Makefile, allowing us to add more source files
later without having to add a new rule for each file. The defines we
pass to each object are also factored into separate lines for easier
modification in future.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Makefile

index 38595a37195084d22c885093b3400631c4757287..4d5a8507b64f6f7cfad7c84c7ff0eb36f9fa116b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,12 @@ GIC_DIST_BASE        := 0x2c001000
 GIC_CPU_BASE   := 0x2c002000
 CNTFRQ         := 0x01800000   # 24Mhz
 
+DEFINES                += -DCNTFRQ=$(CNTFRQ)
+DEFINES                += -DGIC_CPU_BASE=$(GIC_CPU_BASE)
+DEFINES                += -DGIC_DIST_BASE=$(GIC_DIST_BASE)
+DEFINES                += -DSYSREGS_BASE=$(SYSREGS_BASE)
+DEFINES                += -DUART_BASE=$(UART_BASE)
+
 #INITRD_FLAGS  := -DUSE_INITRD
 CPPFLAGS       += $(INITRD_FLAGS)
 
@@ -64,8 +70,8 @@ clean:
 $(IMAGE): boot.o model.lds fdt.dtb $(KERNEL) $(FILESYSTEM)
        $(LD) -o $@ --script=model.lds
 
-boot.o: $(BOOTLOADER) Makefile
-       $(CC) $(CPPFLAGS) -DCNTFRQ=$(CNTFRQ) -DUART_BASE=$(UART_BASE) -DSYSREGS_BASE=$(SYSREGS_BASE) -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DGIC_CPU_BASE=$(GIC_CPU_BASE) -c -o $@ $(BOOTLOADER)
+%.o: %.S Makefile
+       $(CC) $(CPPFLAGS) $(DEFINES) -c -o $@ $<
 
 model.lds: $(LD_SCRIPT) Makefile
        $(CC) $(CPPFLAGS) -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) -DKERNEL=$(KERNEL) -DFILESYSTEM=$(FILESYSTEM) -E -P -C -o $@ $<