Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Posix TextBuf Editor Compiler Runtime Linker Exec86
  9. LINK = Shell.mod Term.o Posix.o TextBuf.o Editor.o Compiler.o Runtime.o Linker.o Exec86.o
  10. all: tpshell
  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. Shell.o: Shell.mod Term.def Posix.def Editor.def TextBuf.def Compiler.def Linker.def
  15. $(GM2) $(FLAGS) -c Shell.mod
  16. Term.o: Term.mod Term.def Posix.def
  17. $(GM2) $(FLAGS) -c Term.mod
  18. TextBuf.o: TextBuf.mod TextBuf.def
  19. $(GM2) $(FLAGS) -c TextBuf.mod
  20. Editor.o: Editor.mod Editor.def Term.def TextBuf.def Posix.def
  21. $(GM2) $(FLAGS) -c Editor.mod
  22. Posix.o: Posix.c Posix.def
  23. $(CC) -c Posix.c
  24. Compiler.o: Compiler.mod Compiler.def TextBuf.def Runtime.def
  25. $(GM2) $(FLAGS) -c Compiler.mod
  26. Runtime.o: Runtime.mod Runtime.def
  27. $(GM2) $(FLAGS) -c Runtime.mod
  28. Linker.o: Linker.mod Linker.def Compiler.def Posix.def
  29. $(GM2) $(FLAGS) -c Linker.mod
  30. # Exec86.def is HAND-MAINTAINED (see its own header): gm2 checks Exec86.mod
  31. # against it and never rewrites it, so it is a prerequisite on purpose - an
  32. # interface change that forgets the .def must not link.
  33. Exec86.o: Exec86.mod Exec86.def
  34. $(GM2) $(FLAGS) -c Exec86.mod
  35. clean:
  36. rm -f *.o tpshell tpshell.lst
  37. .PHONY: all clean