Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. GM2 = /home/eric/bin/Modula2/Gm2/bin/gm2
  2. CC = cc
  3. FLAGS = -fiso
  4. # The whole-program link must be two phases. A single invocation trips gm2's
  5. # pass-3 rollup on a compiler-size program ("too many errors in pass 3"), so
  6. # the import closure is generated first and the link then consumes it. Phase 1
  7. # exiting 1 is the expected rollup, hence the `|| true`.
  8. MODS = Shell Term TermCfg Keys Posix TextBuf Editor Compiler Runtime Linker Exec86
  9. LINK = Shell.mod Term.o TermCfg.o Keys.o Posix.o TextBuf.o Editor.o Compiler.o Runtime.o Linker.o Exec86.o
  10. all: tpshell tp3cfg
  11. tpshell: $(MODS:%=%.o) Shell.mod Makefile
  12. $(GM2) $(FLAGS) -fgen-module-list=tpshell.lst -o /dev/null $(LINK) || true
  13. $(GM2) $(FLAGS) -fuse-list=tpshell.lst -o $@ $(LINK)
  14. # The terminal configurator: writes the TEXT file TP3.TRM, never patches
  15. # tpshell. Same two-phase link (same pass-3 rollup).
  16. tp3cfg: Tp3Cfg.o TermCfg.o Posix.o Tp3Cfg.mod Makefile
  17. $(GM2) $(FLAGS) -fgen-module-list=tp3cfg.lst -o /dev/null Tp3Cfg.mod TermCfg.o Posix.o || true
  18. $(GM2) $(FLAGS) -fuse-list=tp3cfg.lst -o $@ Tp3Cfg.mod TermCfg.o Posix.o
  19. Tp3Cfg.o: Tp3Cfg.mod TermCfg.def Posix.def
  20. $(GM2) $(FLAGS) -c Tp3Cfg.mod
  21. Shell.o: Shell.mod Term.def Posix.def Editor.def TextBuf.def Compiler.def Linker.def
  22. $(GM2) $(FLAGS) -c Shell.mod
  23. Term.o: Term.mod Term.def TermCfg.def Posix.def
  24. $(GM2) $(FLAGS) -c Term.mod
  25. TermCfg.o: TermCfg.mod TermCfg.def Posix.def
  26. $(GM2) $(FLAGS) -c TermCfg.mod
  27. Keys.o: Keys.mod Keys.def TermCfg.def Posix.def
  28. $(GM2) $(FLAGS) -c Keys.mod
  29. TextBuf.o: TextBuf.mod TextBuf.def
  30. $(GM2) $(FLAGS) -c TextBuf.mod
  31. Editor.o: Editor.mod Editor.def Term.def TextBuf.def Posix.def Keys.def
  32. $(GM2) $(FLAGS) -c Editor.mod
  33. Posix.o: Posix.c Posix.def
  34. $(CC) -c Posix.c
  35. Compiler.o: Compiler.mod Compiler.def TextBuf.def Runtime.def
  36. $(GM2) $(FLAGS) -c Compiler.mod
  37. Runtime.o: Runtime.mod Runtime.def
  38. $(GM2) $(FLAGS) -c Runtime.mod
  39. Linker.o: Linker.mod Linker.def Compiler.def Posix.def
  40. $(GM2) $(FLAGS) -c Linker.mod
  41. # Exec86.def is HAND-MAINTAINED (see its own header): gm2 checks Exec86.mod
  42. # against it and never rewrites it, so it is a prerequisite on purpose - an
  43. # interface change that forgets the .def must not link.
  44. Exec86.o: Exec86.mod Exec86.def
  45. $(GM2) $(FLAGS) -c Exec86.mod
  46. clean:
  47. rm -f *.o tpshell tpshell.lst tp3cfg tp3cfg.lst
  48. .PHONY: all clean