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.

73 lines
2.1KB

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