Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # MAKEFILE FOR THE MIPS LINUX BOOTLOADER AND ROM DEBUGGER
  3. #
  4. # i-data Networks
  5. #
  6. # Author: Thomas Horsten <thh@i-data.com>
  7. #
  8. ifndef Version
  9. Version = "$(USER)-test"
  10. endif
  11. MKLASATIMG = mklasatimg
  12. MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
  13. KERNEL_IMAGE = vmlinux
  14. LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
  15. HEAD_DEFINES := -D_kernel_start=$(VMLINUX_LOAD_ADDRESS) \
  16. -D_kernel_entry=$(VMLINUX_ENTRY_ADDRESS) \
  17. -D VERSION="\"$(Version)\"" \
  18. -D TIMESTAMP=$(shell date +%s)
  19. $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
  20. $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
  21. OBJECTS = head.o kImage.o
  22. rom.sw: $(obj)/rom.sw
  23. rom.bin: $(obj)/rom.bin
  24. $(obj)/rom.sw: $(obj)/rom.bin
  25. $(MKLASATIMG) -o $@ -k $^ -m $(MKLASATIMG_ARCH)
  26. $(obj)/rom.bin: $(obj)/rom
  27. $(OBJCOPY) -O binary -S $^ $@
  28. # Rule to make the bootloader
  29. $(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
  30. $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
  31. $(obj)/%.o: $(obj)/%.gz
  32. $(LD) -r -o $@ -b binary $<
  33. $(obj)/%.gz: $(obj)/%.bin
  34. gzip -cf -9 $< > $@
  35. $(obj)/kImage.bin: $(KERNEL_IMAGE)
  36. $(OBJCOPY) -O binary -S $^ $@
  37. clean:
  38. rm -f rom rom.bin rom.sw kImage.bin kImage.o