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.

72 lines
2.0KB

  1. CFSPACK = ../tools/cfspack/cfspack
  2. TARGETS = shell/shell zasm/zasm runbin/runbin
  3. KERNEL = ../kernel
  4. APPS = ../apps
  5. ZASMBIN = zasm/zasm
  6. AVRABIN = zasm/avra
  7. ZASMSH = ./zasm.sh
  8. SHELLAPPS = zasm ed
  9. SHELLTGTS = ${SHELLAPPS:%=cfsin/%}
  10. CFSIN_CONTENTS = $(SHELLTGTS) cfsin/user.h
  11. OBJS = emul.o libz80/libz80.o
  12. .PHONY: all
  13. all: $(TARGETS) $(AVRABIN) $(CFSIN_CONTENTS)
  14. # -o in sync with SHELL_CODE in shell/glue.asm
  15. shell/shell.bin: shell/glue.asm $(ZASMBIN)
  16. $(ZASMSH) $(KERNEL) shell/user.h $(APPS) < shell/glue.asm | tee $@ > /dev/null
  17. shell/shell-bin.h: shell/shell.bin
  18. ./bin2c.sh KERNEL < shell/shell.bin | tee $@ > /dev/null
  19. shell/shell: shell/shell.c $(OBJS) shell/shell-bin.h
  20. $(CC) shell/shell.c $(OBJS) -o $@
  21. zasm/kernel-bin.h: zasm/kernel.bin
  22. ./bin2c.sh KERNEL < zasm/kernel.bin | tee $@ > /dev/null
  23. zasm/zasm-bin.h: zasm/zasm.bin
  24. ./bin2c.sh USERSPACE < zasm/zasm.bin | tee $@ > /dev/null
  25. $(ZASMBIN): zasm/zasm.c $(OBJS) zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
  26. $(CC) zasm/zasm.c $(OBJS) -o $@
  27. zasm/avra.bin: $(ZASMBIN)
  28. $(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/gluea.asm > $@
  29. zasm/avra-bin.h: zasm/avra.bin
  30. ./bin2c.sh USERSPACE < zasm/avra.bin | tee $@ > /dev/null
  31. $(AVRABIN): zasm/zasm.c $(OBJS) zasm/kernel-bin.h zasm/avra-bin.h
  32. $(CC) -D AVRA zasm/zasm.c $(OBJS) -o $@
  33. runbin/runbin: runbin/runbin.c $(OBJS)
  34. $(CC) runbin/runbin.c $(OBJS) -o $@
  35. libz80/libz80.o: libz80/z80.c
  36. $(MAKE) -C libz80/codegen opcodes
  37. $(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c
  38. emul.o: emul.c
  39. $(CC) -c -o emul.o emul.c
  40. $(CFSPACK):
  41. $(MAKE) -C ../tools/cfspack
  42. # -o in sync with USER_CODE in shell/user.h
  43. $(SHELLTGTS): $(ZASMBIN)
  44. $(ZASMSH) -o 42 $(KERNEL) $(APPS) shell/user.h < $(APPS)/${@:cfsin/%=%}/glue.asm > $@
  45. cfsin/user.h: shell/user.h
  46. cp shell/user.h $@
  47. .PHONY: updatebootstrap
  48. updatebootstrap: $(ZASMBIN)
  49. $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
  50. $(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
  51. .PHONY: clean
  52. clean:
  53. rm -f $(TARGETS) $(SHELLTGTS) emul.o zasm/*-bin.h shell/*-bin.h