reorganized linker script rule stuff

This commit is contained in:
Eric J. Bowersox 2013-04-28 21:03:06 -06:00
parent a7fb97cb3a
commit 599e0fc459
3 changed files with 15 additions and 15 deletions

8
kernel/.gitignore vendored
View File

@ -1,6 +1,6 @@
*.s *.s
comrogue-kernel.elf *.lds
comrogue-kernel.lds.parsed kernel.elf
comrogue-kernel.list kernel.list
comrogue-kernel.syms* kernel.syms*
kernel.img kernel.img

View File

@ -54,16 +54,17 @@ INIT_OBJS = start.o kistart.o init_heap.o
all: kernel.img all: kernel.img
comrogue-kernel.elf : $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) comrogue-kernel.lds kernel.elf : $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) kernel.lds
$(CPP) $(ASM_CPP_FLAGS) -P -o comrogue-kernel.lds.parsed comrogue-kernel.lds $(LD) -T kernel.lds $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) $(INIT_OBJS) -o kernel.elf
$(LD) -T comrogue-kernel.lds.parsed $(PRESTART_OBJS) $(LIB_OBJS) $(RES_OBJS) \
$(INIT_OBJS) -o comrogue-kernel.elf
kernel.img : comrogue-kernel.elf kernel.img : kernel.elf
$(OBJDUMP) -D comrogue-kernel.elf > comrogue-kernel.list $(OBJDUMP) -D kernel.elf > kernel.list
$(OBJDUMP) -t comrogue-kernel.elf > comrogue-kernel.syms $(OBJDUMP) -t kernel.elf > kernel.syms
sort comrogue-kernel.syms > comrogue-kernel.syms.sorted sort kernel.syms > kernel.syms.sorted
$(OBJCOPY) comrogue-kernel.elf -O binary kernel.img $(OBJCOPY) kernel.elf -O binary kernel.img
%.lds: %.Lds
$(CPP) $(ASM_CPP_FLAGS) -P -o $@ $<
%.o: %.S %.o: %.S
$(CPP) $(ASM_CPP_FLAGS) -o $(basename $<).s $< $(CPP) $(ASM_CPP_FLAGS) -o $(basename $<).s $<
@ -73,5 +74,4 @@ kernel.img : comrogue-kernel.elf
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
clean: clean:
-rm *.o *.s kernel.img comrogue-kernel.elf comrogue-kernel.lds.parsed comrogue-kernel.list \ -rm *.o *.s *.lds kernel.img kernel.elf kernel.list kernel.syms*
comrogue-kernel.syms*