Jamrules 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. TEXPICDIR = $(TOP)/outpics ;
  2. SOURCEPICDIR = $(TOP)/srcpics ;
  3. rule TexPic
  4. {
  5. Depends $(1) : $(1).eps ;
  6. # LOCATE on $(2) = $(SOURCEPICDIR) ;
  7. LOCATE on $(2) = $(SOURCEPICDIR) ;
  8. Depends $(1).eps : $(2) $(3) $(4) $(5) $(6) ;
  9. MyTexPic $(1).eps : $(1).tex ;
  10. }
  11. rule MyTexPic
  12. {
  13. # LOCATE on $(1) = $(SEARCH_SOURCE) ;
  14. LOCATE on $(1) = $(TEXPICDIR) ;
  15. LOCATE on $(2) = $(SEARCH_SOURCE) ;
  16. Depends pics : $(1) ;
  17. Depends $(1) : $(2) ;
  18. LatexPic $(1) : $(2) ;
  19. }
  20. rule PdfTexPic
  21. {
  22. Depends $(1) : $(1).eps ;
  23. LOCATE on $(2) = $(SOURCEPICDIR) ;
  24. LOCATE on $(1).eps = $(TEXPICDIR) ;
  25. Depends $(1).eps : $(1).pdf ;
  26. Depends $(1).pdf : $(2) $(3) $(4) $(5) $(6) ;
  27. Depends pics : $(1).eps ;
  28. MyPdfTexPic $(1).pdf : $(1).tex ;
  29. MyEpsFromPdf $(1).eps : $(1).pdf ;
  30. }
  31. rule MyPdfTexPic
  32. {
  33. LOCATE on $(1) = $(TEXPICDIR) ;
  34. LOCATE on $(2) = $(SEARCH_SOURCE) ;
  35. Depends $(1) : $(2) ;
  36. PdfLatexPic $(1) : $(2) ;
  37. }
  38. rule MyEpsFromPdf
  39. {
  40. EpsFromPdf $(1) : $(2) ;
  41. }
  42. actions LatexPic
  43. {
  44. echo ActionLatexPic
  45. cd $(SEARCH_SOURCE)
  46. latex $(2:D=.)
  47. # echo dvivile= $(1:D=$(SEARCH_SOURCE)).tmp
  48. dvips -E -o $(1:D=.).tmp $(1:D=.:S=.dvi)
  49. echo crop eps file
  50. cd $(PWD)
  51. pwd
  52. epscrop $(1:D=$(SEARCH_SOURCE)).tmp > $(1)
  53. echo $(TOPDIR)
  54. }
  55. actions PdfLatexPic
  56. {
  57. echo ActionPdfLatexPic
  58. cd $(SEARCH_SOURCE)
  59. pdflatex $(2:D=.)
  60. cd $(PWD)
  61. cp $(1:D=$(SEARCH_SOURCE):S=.pdf) $(1:S=.pdf)
  62. }
  63. actions EpsFromPdf
  64. {
  65. pwd
  66. echo EpsFromPdf $(1) $(2)
  67. gs -dEPSCrop -dTextAlphaBits=4 -sDEVICE=epswrite -sOutputFile=$(1).tmp -dNOPAUSE -dBATCH $(2)
  68. echo epscrop $(1).tmp > $(1)
  69. epscrop $(1).tmp > $(1)
  70. }