beta-0.89.2
[luatex.git] / source / texk / web2c / pmpostdir / am / pmpost.am
bloba70c1de2de07f1fa065e815c55164ed6958ce580
1 ## texk/web2c/pmpostdir/am/pmpost.am: Makefile fragment for pMetaPost.
2 ##
3 ## Copyright (C) 2014, 2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 ## pMetaPost and upMetaPost
7 ##
8 if PMP
9 bin_PROGRAMS += pmpost
10 if WIN32
11 noinst_PROGRAMS += call_pmpost
12 install_exe_links += install-pmpost-links
13 uninstall_exe_links += uninstall-pmpost-links
14 else !WIN32
15 bin_links += pmpost$(EXEEXT):pdvitomp
16 endif !WIN32
17 endif PMP
18 if UPMP
19 bin_PROGRAMS += upmpost
20 if WIN32
21 noinst_PROGRAMS += call_upmpost
22 install_exe_links += install-upmpost-links
23 uninstall_exe_links += uninstall-upmpost-links
24 else !WIN32
25 bin_links += upmpost$(EXEEXT):updvitomp
26 endif !WIN32
27 endif UPMP
28 EXTRA_PROGRAMS += pmpost upmpost
30 call_pmpost_CPPFLAGS = -DEXEPROG=\"pmpost.exe\"
31 nodist_call_pmpost_SOURCES = callexe.c
32 call_pmpost_LDADD =
34 call_upmpost_CPPFLAGS = -DEXEPROG=\"upmpost.exe\"
35 nodist_call_upmpost_SOURCES = callexe.c
36 call_upmpost_LDADD =
38 pmpost_CPPFLAGS = $(MPFR_INCLUDES) $(GMP_INCLUDES) $(CAIRO_INCLUDES) $(PIXMAN_INCLUDES) \
39         $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/mplibdir
40 pmpost_LDADD = $(PTEXENC_LIBS) $(KPATHSEA_LIBS) $(MPFR_LIBS) $(GMP_LIBS) \
41         $(CAIRO_LIBS) $(PIXMAN_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) libmputil.a
43 upmpost_CPPFLAGS = -DUPMP $(pmpost_CPPFLAGS)
44 upmpost_LDADD = $(pmpost_LDADD)
46 .PHONY: install-pmpost-links install-upmpost-links uninstall-pmpost-links uninstall-upmpost-links
47 if WIN32
48 install-pmpost-links: call_pmpost$(EXEEXT)
49         $(INSTALL_PROGRAM) call_pmpost$(EXEEXT) $(DESTDIR)$(bindir)/pdvitomp$(EXEEXT)
50 install-upmpost-links: call_upmpost$(EXEEXT)
51         $(INSTALL_PROGRAM) call_upmpost$(EXEEXT) $(DESTDIR)$(bindir)/updvitomp$(EXEEXT)
52 uninstall-pmpost-links:
53         rm -f $(DESTDIR)$(bindir)/pdvitomp$(EXEEXT)
54 uninstall-upmpost-links:
55         rm -f $(DESTDIR)$(bindir)/updvitomp$(EXEEXT)
56 endif WIN32
58 # Creating one file: just one rule
59 pmp_ctangle = $(ctangle_silent)CWEBINPUTS=.:$(srcdir)/pmpostdir $(ctangle)
60 # Creating several files: need stamp file and two rules with identical recipes
61 pmp_ctangle_sh = CWEBINPUTS=.:$(srcdir)/pmpostdir AM_V_P=$(AM_V_P) $(SHELL) ./tangle-sh $@ $(CTANGLE)
63 ## pMetaPost C sources
64 nodist_pmpost_SOURCES = $(pmp_c_h) $(pmpmath_c_h) $(pmpmathbinary_c_h) $(pmpmathdecimal_c_h) \
65         $(pmpmathdouble_c_h) pmpost.c $(pmpstrings_c_h) $(pmpxout_c_h) \
66         $(ppngout_c_h) $(ppsout_c_h) $(psvgout_c_h) ptfmin.c
67 pmp_c_h =  pmp.c pmplib.h pmpmp.h
68 pmpmath_c_h = pmpmath.c pmpmath.h
69 pmpmathbinary_c_h = pmpmathbinary.c pmpmathbinary.h
70 pmpmathdecimal_c_h = pmpmathdecimal.c pmpmathdecimal.h
71 pmpmathdouble_c_h = pmpmathdouble.c pmpmathdouble.h
72 pmpstrings_c_h = pmpstrings.h pmpstrings.c
73 pmpxout_c_h = pmpxout.c pmpxout.h
74 ppngout_c_h = pmplibpng.h pmppngout.h ppngout.c
75 ppsout_c_h = pmppsout.h ppsout.c pmplibps.h
76 psvgout_c_h = pmplibsvg.h pmpsvgout.h psvgout.c
78 ## upMetaPost C sources
79 nodist_upmpost_SOURCES = $(nodist_pmpost_SOURCES)
81 # sed script
82 pmp_sed_main = 's/mpxout\.h/pmpxout.h/;s/mpmp\.h/pmpmp.h/;s/mplib\.h/pmplib.h/;s/mpstrings\.h/pmpstrings.h/'
83 pmp_sed_math = 's/mpmath\([a-z]*\)\.h/pmpmath\1.h/'
84 pmp_sed_ps   = 's/mplibps\.h/pmplibps.h/;s/mppsout\.h/pmppsout.h/'
85 pmp_sed_svg  = 's/mplibsvg\.h/pmplibsvg.h/;s/mpsvgout\.h/pmpsvgout.h/'
86 pmp_sed_png  = 's/mplibpng\.h/pmplibpng.h/;s/mppngout\.h/pmppngout.h/'
87 pmp_sed = sed -e $(pmp_sed_main) -e $(pmp_sed_math) -e $(pmp_sed_ps) -e $(pmp_sed_svg) -e $(pmp_sed_png)
89 pmp.w: mplibdir/mp.w
90         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/mp.w >$@
91 pmpmath.c: mpmath.c
92         $(AM_V_GEN)$(pmp_sed) mpmath.c >$@
93 pmpmath.h: mpmath.h
94         $(AM_V_GEN)$(pmp_sed) mpmath.h >$@
95 pmpmathbinary.c: mpmathbinary.c
96         $(AM_V_GEN)$(pmp_sed) mpmathbinary.c >$@
97 pmpmathbinary.h: mpmathbinary.h
98         $(AM_V_GEN)$(pmp_sed) mpmathbinary.h >$@
99 pmpmathdecimal.c: mpmathdecimal.c
100         $(AM_V_GEN)$(pmp_sed) mpmathdecimal.c >$@
101 pmpmathdecimal.h: mpmathdecimal.h
102         $(AM_V_GEN)$(pmp_sed) mpmathdecimal.h >$@
103 pmpmathdouble.c: mpmathdouble.c
104         $(AM_V_GEN)$(pmp_sed) mpmathdouble.c >$@
105 pmpmathdouble.h: mpmathdouble.h
106         $(AM_V_GEN)$(pmp_sed) mpmathdouble.h >$@
107 pmpost.w: mplibdir/mpost.w
108         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/mpost.w >$@
109 pmpstrings.c: mpstrings.c
110         $(AM_V_GEN)$(pmp_sed) mpstrings.c >$@
111 pmpstrings.h: mpstrings.h
112         $(AM_V_GEN)$(pmp_sed) mpstrings.h >$@
113 pmpxout.w: mplibdir/mpxout.w
114         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/mpxout.w >$@
115 pmplibpng.h: mplibpng.h
116         $(AM_V_GEN)$(pmp_sed) mplibpng.h >$@
117 pmppngout.h: mppngout.h
118         $(AM_V_GEN)$(pmp_sed) mppngout.h >$@
119 ppngout.c: pngout.c
120         $(AM_V_GEN)$(pmp_sed) pngout.c >$@
121 ppsout.w: mplibdir/psout.w
122         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/psout.w >$@
123 psvgout.w: mplibdir/svgout.w
124         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/svgout.w >$@
125 ptfmin.w: mplibdir/tfmin.w
126         $(AM_V_GEN)$(pmp_sed) $(srcdir)/mplibdir/tfmin.w >$@
128 # Creating one file: just one rule
129 pmpost.c: ctangle$(EXEEXT) pmpost.w pmpostdir/pmpost.ch
130         $(pmp_ctangle) pmpost pmpost
131 ptfmin.c: ctangle$(EXEEXT) ptfmin.w pmpostdir/ptfmin.ch
132         $(pmp_ctangle) ptfmin ptfmin
134 # Creating several files: need stamp file and two rules with identical recipes
135 $(pmp_c_h): pmp-tangle
136         @$(pmp_ctangle_sh) pmp pmp
137 pmp-tangle: ctangle$(EXEEXT) pmp.w pmpostdir/pmp.ch tangle-sh
138         @$(pmp_ctangle_sh) pmp pmp
140 $(pmpxout_c_h): pmpxout-tangle
141         @$(pmp_ctangle_sh) pmpxout pmpxout
142 pmpxout-tangle: ctangle$(EXEEXT) pmpxout.w pmpostdir/pmpxout.ch tangle-sh
143         @$(pmp_ctangle_sh) pmpxout pmpxout
145 $(ppsout_c_h): ppsout-tangle
146         @$(pmp_ctangle_sh) ppsout ppsout
147 ppsout-tangle: ctangle$(EXEEXT) ppsout.w pmpostdir/ppsout.ch tangle-sh
148         @$(pmp_ctangle_sh) ppsout ppsout
150 $(psvgout_c_h): psvgout-tangle
151         @$(pmp_ctangle_sh) psvgout psvgout
152 psvgout-tangle: ctangle$(EXEEXT) psvgout.w pmpostdir/psvgout.ch tangle-sh
153         @$(pmp_ctangle_sh) psvgout psvgout
155 ## pMetaPost CWeb sources
156 pmpost_web = pmpostdir/pmp.ch pmpostdir/pmpost.ch pmpostdir/pmpxout.ch pmpostdir/ppsout.ch \
157         pmpostdir/psvgout.ch pmpostdir/ptfmin.ch
159 $(pmpost_OBJECTS) $(upmpost_OBJECTS): $(nodist_pmpost_SOURCES) $(PTEXENC_DEPEND) \
160         $(LIBPNG_DEPEND) $(CAIRO_DEPEND) $(MPFR_DEPEND)
161         
162 EXTRA_DIST += pmpostdir/ChangeLog $(pmpost_web) 
164 DISTCLEANFILES += $(nodist_pmpost_SOURCES) \
165         pmp.w pmpost.w pmpxout.w ppsout.w psvgout.w ptfmin.w \
166         pmp-tangle pmpxout-tangle ppsout-tangle psvgout-tangle
168 ## (u)pMetaPost Tests
170 pmpost_tests = pmpostdir/pmpost.test pmpostdir/pmpsamp.test
171 pmpostdir/pmpost.log pmpostdir/pmpsamp.log: pmpost$(EXEEXT)
172 upmpost_tests = pmpostdir/upmpost.test pmpostdir/upmpsamp.test
173 pmpostdir/upmpost.log pmpostdir/upmpsamp.log: upmpost$(EXEEXT)
175 EXTRA_DIST += $(pmpost_tests) $(upmpost_tests)
177 if PMP
178 TESTS += $(pmpost_tests)
179 endif PMP
180 if UPMP
181 TESTS += $(upmpost_tests)
182 endif UPMP
184 EXTRA_DIST += pmpostdir/tests/psample.mp
185 ## pmpostdir/pmpsamp.test
186 DISTCLEANFILES += pmpsamp.*
187 ## pmpostdir/upmpsamp.test
188 DISTCLEANFILES += upmpsamp.*