Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3KB

  1. CFSPACK = ../cfspack/cfspack
  2. TARGETS = shell/shell zasm/zasm runbin/runbin
  3. KERNEL = ../../kernel
  4. APPS = ../../apps
  5. ZASMBIN = zasm/zasm
  6. ZASMSH = ../zasm.sh
  7. SHELLAPPS = $(addprefix cfsin/, zasm ed)
  8. CFSIN_CONTENTS = $(SHELLAPPS) cfsin/user.h
  9. .PHONY: all
  10. all: $(TARGETS) $(CFSIN_CONTENTS)
  11. shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN)
  12. $(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null
  13. zasm/kernel-bin.h: zasm/kernel.bin
  14. ./bin2c.sh KERNEL < $< | tee $@ > /dev/null
  15. zasm/zasm-bin.h: zasm/zasm.bin
  16. ./bin2c.sh USERSPACE < $< | tee $@ > /dev/null
  17. shell/shell: shell/shell.c libz80/libz80.o shell/kernel-bin.h
  18. $(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
  19. runbin/runbin: runbin/runbin.c libz80/libz80.o
  20. $(TARGETS):
  21. $(CC) $< libz80/libz80.o -o $@
  22. libz80/libz80.o: libz80/z80.c
  23. $(MAKE) -C libz80/codegen opcodes
  24. $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
  25. $(CFSPACK):
  26. $(MAKE) -C ../cfspack
  27. $(SHELLAPPS): $(ZASMBIN)
  28. $(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@
  29. cfsin/user.h: shell/user.h
  30. cp $< $@
  31. .PHONY: updatebootstrap
  32. updatebootstrap: $(ZASMBIN) $(INCCFS)
  33. $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
  34. $(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
  35. .PHONY: clean
  36. clean:
  37. rm -f $(TARGETS) $(SHELLAPPS) {zasm,shell}/*-bin.h