Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #######################################################################
  2. #
  3. # Makefile to compile all examples and convert them to LaTeX
  4. #
  5. #######################################################################
  6. # Compiler
  7. ifndef FPC
  8. ifdef PP
  9. FPC=$(PP)
  10. endif
  11. endif
  12. ifndef FPC
  13. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  14. ifneq ($(FPCPROG),)
  15. FPCPROG:=$(firstword $(FPCPROG))
  16. FPC:=$(shell $(FPCPROG) -PB)
  17. ifneq ($(findstring Error,$(FPC)),)
  18. override FPC=ppc386
  19. endif
  20. else
  21. override FPC=ppc386
  22. endif
  23. endif
  24. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  25. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  26. # Unit directory
  27. # UNITDIR=/usr/lib/ppc/0.99.0/linuxunits
  28. # Any options you wish to pass.
  29. PPOPTS=
  30. # Script to convert the programs to LaTeX examples which can be included.
  31. PP2TEX=../pp2tex
  32. # Script to convert the C programs to LaTeX examples which can be included.
  33. C2TEX=./c2tex
  34. # Script to collect all examples in 1 file.
  35. MAKETEX=make1tex
  36. #######################################################################
  37. # No need to edit after this line.
  38. #######################################################################
  39. ifdef UNITDIR
  40. PPOPTS:=$(PPOPTS) -Up$(UNITDIR);
  41. endif
  42. .SUFFIXES: .pp .tex
  43. .PHONY: all tex clean
  44. OBJECTS=plsubs psubs
  45. COBJECTS=ctest ctest2
  46. LIBOBJECT=libsubs.so
  47. TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))
  48. TEXOBJECTS:=$(TEXOBJECTS) subs.tex
  49. CTEXOBJECTS=$(addsuffix .tex, $(COBJECTS))
  50. all : $(LIBOBJECTS) $(OBJECTS) $(COBJECTS)
  51. tex : $(TEXOBJECTS) $(CTEXOBJECTS) subs.tex
  52. onetex : tex
  53. $(MAKETEX) $(TEXOBJECTS)
  54. clean :
  55. rm -f *.o *.s *.so $(OBJECTS) $(COBJECTS) $(TEXOBJECTS) $(CTEXOBJECTS)
  56. rm -f *.ow *.sw *.exe *.dll
  57. $(OBJECTS): %: %.pp $(LIBOBJECT)
  58. $(FPC) $(PPOPTS) $*
  59. $(TEXOBJECTS): %.tex: %.pp head.tex foot.tex
  60. $(PP2TEX) $*
  61. $(CTEXOBJECTS): %.tex: %.c head.tex foot.tex
  62. $(C2TEX) $*
  63. libsubs.so: subs.pp
  64. $(FPC) $(PPOPTS) $<
  65. ctest: ctest.c libsubs.so
  66. $(CC) -o ctest ctest.c -lsubs
  67. ctest2: ctest2.c libsubs.so
  68. $(CC) -o ctest2 ctest2.c -ldl