Debian Codegraph @

texk/web2c/mplibdir/am/mplib.am

raw
1 ## $Id: mplib.am 69664 2024-02-01 22:56:12Z karl $
2 ## texk/web2c/mplibdir/am/mplib.am: Makefile fragment for MetaPost.
3 ##
4 ## Copyright 2017-2022 Luigi Scarso <[email protected]>
5 ## Copyright 2009-2015 Peter Breitenlohner <[email protected]>
6 ## You may freely use, modify and/or distribute this file.
7
8 ## MetaPost
9 ##
10 if MP
11 bin_PROGRAMS += mpost
12 if WIN32
13 noinst_PROGRAMS += call_mpost
14 install_exe_links += install-mpost-links
15 uninstall_exe_links += uninstall-mpost-links
16 else !WIN32
17 bin_links += mpost$(EXEEXT):dvitomp mpost$(EXEEXT):mfplain
18 bin_links += mpost$(EXEEXT):r-mpost
19 endif !WIN32
20 endif MP
21 EXTRA_PROGRAMS += mpost
22
23 mpost_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) -I$(srcdir)/mplibdir
24 mpost_LDADD = libmplibcore.a libmplibextramath.a libmplibbackends.a $(KPATHSEA_LIBS) $(MPFI_LIBS) $(MPFR_LIBS) $(GMP_LIBS) \
25 $(CAIRO_LIBS) $(PIXMAN_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) libmputil.a
26
27
28
29 call_mpost_CPPFLAGS = -DEXEPROG=\"mpost.exe\"
30 nodist_call_mpost_SOURCES = callexe.c
31 call_mpost_LDADD =
32
33 .PHONY: install-mpost-links uninstall-mpost-links
34 if WIN32
35 install-mpost-links: call_mpost$(EXEEXT)
36 $(INSTALL_PROGRAM) call_mpost$(EXEEXT) $(DESTDIR)$(bindir)/dvitomp$(EXEEXT)
37 $(INSTALL_PROGRAM) call_mpost$(EXEEXT) $(DESTDIR)$(bindir)/mfplain$(EXEEXT)
38 uninstall-mpost-links:
39 rm -f $(DESTDIR)$(bindir)/dvitomp$(EXEEXT)
40 rm -f $(DESTDIR)$(bindir)/mfplain$(EXEEXT)
41 endif WIN32
42
43 # Creating one file: just one rule
44 mp_ctangle = $(ctangle_silent)CWEBINPUTS=$(srcdir)/mplibdir $(ctangle)
45 # Creating several files: need stamp file and two rules with identical recipes
46 mp_ctangle_sh = CWEBINPUTS=$(srcdir)/mplibdir AM_V_P=$(AM_V_P) $(SHELL) ./tangle-sh $@ $(CTANGLE)
47
48 ## MetaPost C sources
49 nodist_mpost_SOURCES = mpost.c $(mpxout_c_h)
50 mpxout_c_h = mpxout.c mpxout.h
51
52 mpost.c: ctangle$(EXEEXT) mplibdir/mpost.w
53 $(mp_ctangle) mpost.w
54
55 $(mpxout_c_h): mpxout-tangle
56 $(mp_ctangle_sh) mpxout
57 mpxout-tangle: ctangle$(EXEEXT) mplibdir/mpxout.w tangle-sh
58 $(mp_ctangle_sh) mpxout
59
60 ## MetaPost CWeb sources
61 mpost_web = mplibdir/mpost.w mplibdir/mpxout.w
62
63 #$(mpost_OBJECTS): $(nodist_mpost_SOURCES) libmplib.a $(LIBPNG_DEPEND)
64 $(mpost_OBJECTS): $(nodist_mpost_SOURCES) libmplibcore.a libmplibextramath.a libmplibbackends.a $(LIBPNG_DEPEND)
65
66 EXTRA_DIST += mplibdir/ChangeLog $(mpost_web)
67
68 DISTCLEANFILES += $(nodist_mpost_SOURCES) mpxout-tangle
69
70 ## MetaPost Tests
71 ##
72 mp_tests = mplibdir/dvitomp.test mplibdir/mptraptest.test
73 mplibdir/dvitomp.log: mpost$(EXEEXT)
74 mplibdir/mptraptest.log: mpost$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
75
76 EXTRA_DIST += $(mp_tests)
77
78 if MP
79 TESTS += $(mp_tests)
80 TRIPTRAP += mptrap.diffs
81 TRIPTRAP_CLEAN += mptrap-clean
82 endif MP
83 DISTCLEANFILES += mptrap.diffs
84
85 ## mplibdir/dvitomp.test
86 DISTCLEANFILES += ptmr.mpx tests/xptmr.mpx tests/xstory.mpx
87 ## mplibdir/mptraptest
88 mptrap.diffs: mpost$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
89 $(triptrap_diffs) $@
90 .PHONY: mptrap-clean
91 mptrap-clean:
92 rm -rf mptrapdir
93
94 # (end of mplib.am)