Makefile 879 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # this was called from the Makefile in /,
  2. # and we just tell it what objects that he should make.
  3. BITS = 64
  4. asm = boot/boot$(BITS).S boot/setup$(BITS).S
  5. asmobj = boot/boot$(BITS).S.o boot/setup$(BITS).S.o
  6. obj-i +=
  7. target:
  8. ifeq ($(D), )
  9. @echo "this should call from the Makefile in directory /, but not typing make in kernel/. :-(" >&2
  10. @exit 1
  11. endif
  12. @echo "-m$(BITS)" > .archcflags
  13. # $(PWD) is the / directory of kernel, e.g. /root/evx/
  14. @$(MAKE) -C $(PWD) D=$(shell pwd) obj-i="$(obj-i)"
  15. vmevx.o: $(PWD)/.objlist
  16. @$(MAKE) -C init/ BITS=$(BITS)
  17. @cat $(PWD)/.objlist | xargs $(LD) -o vmevx.o -T vmevx$(BITS).lds
  18. @echo "LD vmevx.o"
  19. vmevx.bin: vmevx.o
  20. @objcopy -S -R ".comment" -R ".eh_frame" -O binary vmevx.o vmevx.bin
  21. boot: vmevx.bin
  22. @$(MAKE) -C boot/ BITS=$(BITS)
  23. .PHONY clean:
  24. @$(MAKE) -C boot/ clean
  25. @$(MAKE) -C init/ clean