Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #######################################################################
  2. #
  3. # Makefile to compile all examples and convert them to LaTeX
  4. #
  5. #######################################################################
  6. # Compiler
  7. PP=ppc386
  8. # Unit directory
  9. # UNITDIR=/usr/lib/ppc/0.99.0/linuxunits
  10. # Any options you wish to pass.
  11. PPOPTS=
  12. # Script to convert the programs to LaTeX examples which can be included.
  13. PP2TEX=../pp2tex
  14. # Script to convert the C programs to LaTeX examples which can be included.
  15. C2TEX=./c2tex
  16. # Script to collect all examples in 1 file.
  17. MAKETEX=make1tex
  18. #######################################################################
  19. # No need to edit after this line.
  20. #######################################################################
  21. ifdef UNITDIR
  22. PPOPTS:=$(PPOPTS) -Up$(UNITDIR);
  23. endif
  24. .SUFFIXES: .pp .tex
  25. .PHONY: all tex clean
  26. OBJECTS=plsubs psubs
  27. COBJECTS=ctest ctest2
  28. LIBOBJECT=libsubs.so
  29. TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))
  30. TEXOBJECTS:=$(TEXOBJECTS) subs.tex
  31. CTEXOBJECTS=$(addsuffix .tex, $(COBJECTS))
  32. all : $(LIBOBJECTS) $(OBJECTS) $(COBJECTS)
  33. tex : $(TEXOBJECTS) $(CTEXOBJECTS) subs.tex
  34. onetex : tex
  35. $(MAKETEX) $(TEXOBJECTS)
  36. clean :
  37. rm -f *.o *.s *.so $(OBJECTS) $(COBJECTS) $(TEXOBJECTS) $(CTEXOBJECTS)
  38. rm -f *.ow *.sw *.exe *.dll
  39. $(OBJECTS): %: %.pp $(LIBOBJECT)
  40. $(PP) $(PPOPTS) $*
  41. $(TEXOBJECTS): %.tex: %.pp head.tex foot.tex
  42. $(PP2TEX) $*
  43. $(CTEXOBJECTS): %.tex: %.c head.tex foot.tex
  44. $(C2TEX) $*
  45. libsubs.so: subs.pp
  46. $(PP) $(PPOPTS) $<
  47. ctest: ctest.c libsubs.so
  48. $(CC) -o ctest ctest.c -lsubs
  49. ctest2: ctest2.c libsubs.so
  50. $(CC) -o ctest2 ctest2.c -ldl