Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 collect all examples in 1 file.
  33. MAKETEX=make1tex
  34. #######################################################################
  35. # No need to edit after this line.
  36. #######################################################################
  37. ifdef UNITDIR
  38. PPOPTS:=$(PPOPTS) -Up$(UNITDIR);
  39. endif
  40. .SUFFIXES: .pp .tex
  41. .PHONY: all tex clean execute
  42. OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 ex13 ex14 \
  43. ex15 ex16 ex17 ex18 ex19 ex20 ex21 ex22 ex23 ex24 ex25 ex26 ex27 \
  44. ex28 ex29 ex30 ex31 ex32 ex33 ex34 ex35 ex36 ex37 ex38 ex39 ex40 \
  45. ex41 ex42 ex43 ex44 ex45 ex46 ex47 ex48 ex49 ex50 ex51 ex52 ex53 \
  46. ex54 ex55 ex56 ex57 ex58 ex59 ex60 ex61 ex62 ex63 ex64 ex65 ex66 \
  47. ex67 ex68 ex69 ex70 ex71 ex72 ex73 ex74 ex75 ex76 ex77 ex78 ex79 \
  48. ex80 ex81 ex82 ex83 ex84 ex85 ex86 ex87 ex88 ex89 \
  49. ex90 ex91 ex92 ex93 ex94 ex95 ex96 ex97 ex98 ex99 ex100 ex101 ex102\
  50. ex103 ex104 ex105 ex106 ex107 ex108 ex109 ex110 ex111 ex112
  51. TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))
  52. # This is not the same list as objects, since some of the
  53. # tests are interactive.
  54. TOTEST=ex1 ex2 ex3 ex4 ex5 ex8 ex9 ex10 ex11 ex12 ex13 ex14 \
  55. ex15 ex16 ex17 ex20 ex21 ex22 ex23 ex25 ex26 ex27 \
  56. ex28 ex29 ex31 ex32 ex33 ex34 ex36 ex37 ex38 ex39 ex40 \
  57. ex41 ex42 ex43 ex44 ex45 ex47 ex48 ex52 ex53 \
  58. ex54 ex56 ex59 ex60 ex62 ex63 ex64 ex65 ex66 \
  59. ex67 ex68 ex69 ex70 ex71 ex72 ex73 ex75 ex76 ex78 ex79 \
  60. ex80 ex81 ex82 ex83 ex85 ex86 ex87 ex88 ex89 \
  61. ex90 ex91 ex92 ex93 ex96 ex97 ex98 ex99 ex100 ex101 ex102\
  62. ex103 ex104 ex105 ex106 ex107 ex108 ex109 ex110 ex111 ex112
  63. LOGFILE=$(addsuffix .log, $(TOTEST))
  64. all : $(OBJECTS)
  65. tex : $(TEXOBJECTS)
  66. execute: $(LOGFILE)
  67. onetex : tex
  68. $(MAKETEX) $(TEXOBJECTS)
  69. clean :
  70. rm -f *.o *.s *.rst $(OBJECTS) $(TEXOBJECTS)
  71. rm -f *.ow *.sw *.exe *.dll *.log *.tmp
  72. $(OBJECTS): %: %.pp
  73. $(FPC) $(PPOPTS) $*
  74. $(TEXOBJECTS): %.tex: %.pp head.tex foot.tex
  75. $(PP2TEX) $*
  76. $(LOGFILE): %.log: %.exe
  77. $* > $*.log