From 599e0fc4593b0559efc0c9113e334101e6a79b40 Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Sun, 28 Apr 2013 21:03:06 -0600 Subject: [PATCH] reorganized linker script rule stuff --- kernel/.gitignore | 8 ++++---- kernel/Makefile | 22 +++++++++++----------- kernel/{comrogue-kernel.lds => kernel.Lds} | 0 3 files changed, 15 insertions(+), 15 deletions(-) rename kernel/{comrogue-kernel.lds => kernel.Lds} (100%) diff --git a/kernel/.gitignore b/kernel/.gitignore index 99d483b..50948c7 100644 --- a/kernel/.gitignore +++ b/kernel/.gitignore @@ -1,6 +1,6 @@ *.s -comrogue-kernel.elf -comrogue-kernel.lds.parsed -comrogue-kernel.list -comrogue-kernel.syms* +*.lds +kernel.elf +kernel.list +kernel.syms* kernel.img diff --git a/kernel/Makefile b/kernel/Makefile index 6d2aa92..8b0df50 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -54,16 +54,17 @@ INIT_OBJS = start.o kistart.o init_heap.o all: kernel.img -comrogue-kernel.elf : $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) comrogue-kernel.lds - $(CPP) $(ASM_CPP_FLAGS) -P -o comrogue-kernel.lds.parsed comrogue-kernel.lds - $(LD) -T comrogue-kernel.lds.parsed $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) \ - $(INIT_OBJS) -o comrogue-kernel.elf +kernel.elf : $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) kernel.lds + $(LD) -T kernel.lds $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) -o kernel.elf -kernel.img : comrogue-kernel.elf - $(OBJDUMP) -D comrogue-kernel.elf > comrogue-kernel.list - $(OBJDUMP) -t comrogue-kernel.elf > comrogue-kernel.syms - sort comrogue-kernel.syms > comrogue-kernel.syms.sorted - $(OBJCOPY) comrogue-kernel.elf -O binary kernel.img +kernel.img : kernel.elf + $(OBJDUMP) -D kernel.elf > kernel.list + $(OBJDUMP) -t kernel.elf > kernel.syms + sort kernel.syms > kernel.syms.sorted + $(OBJCOPY) kernel.elf -O binary kernel.img + +%.lds: %.Lds + $(CPP) $(ASM_CPP_FLAGS) -P -o $@ $< %.o: %.S $(CPP) $(ASM_CPP_FLAGS) -o $(basename $<).s $< @@ -73,5 +74,4 @@ kernel.img : comrogue-kernel.elf $(CC) $(CFLAGS) -c -o $@ $< clean: - -rm *.o *.s kernel.img comrogue-kernel.elf comrogue-kernel.lds.parsed comrogue-kernel.list \ - comrogue-kernel.syms* + -rm *.o *.s *.lds kernel.img kernel.elf kernel.list kernel.syms* diff --git a/kernel/comrogue-kernel.lds b/kernel/kernel.Lds similarity index 100% rename from kernel/comrogue-kernel.lds rename to kernel/kernel.Lds