summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/mplibdir/am/mplib.am
blob: 64adde04a0848965e40c6a6748f2f086e0b6d8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
## texk/web2c/mplibdir/am/mplib.am: Makefile fragment for MetaPost.
##
## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.

## MetaPost
##
if MP
bin_PROGRAMS += mpost
endif MP
EXTRA_PROGRAMS += mpost

mpost_CPPFLAGS = -I$(srcdir)/mplibdir
mpost_CFLAGS = $(WARNING_CFLAGS)
mpost_DEPENDENCIES = libmplib.a
mpost_LDADD = libmplib.a $(KPATHSEA_LIBS) -lm

# Creating one file: just one rule
mp_ctangle = CWEBINPUTS=$(srcdir)/mplibdir $(ctangle)
# Creating several files: need stamp file and two identical rules
mp_ctangle_sh = CWEBINPUTS=$(srcdir)/mplibdir $(SHELL) ./tangle-sh $@ $(CTANGLE)

## MetaPost C sources
nodist_mpost_SOURCES = mpost.c $(mpxout_c_h)
mpxout_c_h = mpxout.c mpxout.h

mpost.c: ctangle$(EXEEXT) mplibdir/mpost.w
	$(mp_ctangle) mpost.w

$(mpxout_c_h): mpxout-tangle
	@$(mp_ctangle_sh) mpxout
mpxout-tangle: ctangle$(EXEEXT) mplibdir/mpxout.w tangle-sh
	@$(mp_ctangle_sh) mpxout

## MetaPost CWeb sources
mpost_web = mplibdir/mpost.w mplibdir/mpxout.w

$(mpost_OBJECTS): $(nodist_mpost_SOURCES) libmplib.a

EXTRA_DIST += mplibdir/ChangeLog $(mpost_web)

DISTCLEANFILES += $(nodist_mpost_SOURCES) mpxout-tangle

# Double-colon rules since we do something similar in luatexdir (maybe others).
if MP
install-exec-hook::
	cd $(DESTDIR)$(bindir) && rm -f dvitomp$(EXEEXT) \
	  && $(LN_S) mpost$(EXEEXT) dvitomp$(EXEEXT)
uninstall-hook::
	rm -f $(DESTDIR)$(bindir)/dvitomp$(EXEEXT)
endif MP

## MetaPost Tests
##
mp_tests = mplibdir/dvitomp.test mplibdir/mptrap.test

EXTRA_DIST += $(mp_tests)

if MP
TESTS += $(mp_tests)
check_PROGRAMS += pltotf tftopl
endif MP

.PHONY: mptrap-clean
clean-local:: mptrap-clean
## dvitomp.test
DISTCLEANFILES += ptmr.mpx tests/xptmr.mpx tests/xstory.mpx
## mptrap.test
mptrap-clean:
	rm -f mtrap.mp mtrap.mem trapf.tfm
	rm -f mtrap.log mtrap.0 mtrap.1 writeo writeo.log writeo.2
	rm -f trap.mp trap.mpx mptrapin.fot mptrapin.log
	rm -f mptrap.fot mptrap.log mptrap.tfm
	rm -f trap.ps trap.mem trap.0 trap.5 trap.6 trap.95 trap.96 trap.97
	rm -f trap.98 trap.99 trap.100 trap.101 trap.102 trap.103 trap.104
	rm -f trap.105 trap.106 trap.107 trap.108 trap.109 trap.148
	rm -f trap.149 trap.150 trap.151 trap.197 trap.200
	rm -f mptrap.pl