Debian Codegraph @

texk/web2c/pmpostdir/am/pmpost.am

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