Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 -n "-m$(BITS) " > .archcflags
  13. @echo -n "-I`pwd`/include " >> .archcflags
  14. @echo -n "-I`pwd`/include$(BITS) " >> .archcflags
  15. # must be the first
  16. @echo "`pwd`/init/head$(BITS).S.o" > $(PWD)/.objlist
  17. # $(PWD) is the / directory of kernel, e.g. /root/evx/
  18. @$(MAKE) -C $(PWD) D=$(shell pwd) obj-i="$(obj-i)"
  19. vmevx.o: $(PWD)/.objlist
  20. @$(MAKE) -C init/ BITS=$(BITS)
  21. @cat $(PWD)/.objlist | xargs $(LD) -o vmevx.o -T vmevx$(BITS).lds
  22. @echo "LD vmevx.o"
  23. vmevx.bin: vmevx.o
  24. @objcopy -S -R ".comment" -R ".eh_frame" -O binary vmevx.o vmevx.bin
  25. boot: vmevx.bin
  26. @$(MAKE) -C boot/ BITS=$(BITS)
  27. .PHONY clean:
  28. @$(MAKE) -C boot/ clean
  29. @$(MAKE) -C init/ clean