## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX. ## ## Copyright (C) 2010 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## pTeX library ## sub_dirs += ptexdir/lib pproglib = ptexdir/lib/lib.a # Rebuild $(pproglib) $(pproglib): $(KPATHSEA_DEPEND) ${srcdir}/ptexdir/lib/*.c cd ptexdir/lib && $(MAKE) $(AM_MAKEFLAGS) ## Rebuild libptexenc @PTEXENC_RULE@ ptex_cppflags = $(PTEXENC_INCLUDES) ptex_ldadd = $(pproglib) $(PTEXENC_LIBS) $(LDADD) pweb_programs = pbibtex pdvitype ptftopl ppltotf p_tangle = WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE) DISTCLEANFILES += $(pweb_programs:=.c) $(pweb_programs:=.h) \ $(pweb_programs:=.p) $(pweb_programs:=-web2c) $(pweb_programs:=.web) ## pTeX ## if PTEX bin_PROGRAMS += ptex if WEB bin_PROGRAMS += $(pweb_programs) endif WEB endif PTEX EXTRA_PROGRAMS += ptex $(pweb_programs) ptex_CPPFLAGS = $(ptex_cppflags) ptex_CFLAGS = $(WARNING_CFLAGS) # With --enable-ipc, pTeX may need to link with -lsocket. ptex_LDADD = $(ptex_ldadd) $(ipc_socketlibs) # pTeX C sources ptex_c_h = ptexini.c ptex0.c ptexcoerce.h ptexd.h nodist_ptex_SOURCES = $(ptex_c_h) ptex-pool.c ptexextra.c ptexdir/ptexextra.h ptex_SOURCES = ptexdir/kanji.c ptexdir/kanji.h # We must create ptexd.h before building the ptex_OBJECTS. ptex_prereq = ptexd.h $(ptex_OBJECTS): $(ptex_prereq) $(ptex_c_h): ptex-web2c @$(web2c) ptex ptex-web2c: ptex.p $(web2c_texmf) ptexdir/ptex.defines @$(web2c) ptex ptex-pool.c: ptex.pool ptexd.h $(makecpool_stamp) $(makecpool) ptex >$@ || rm -f $@ ptexextra.c: ptexdir/ptexextra.h lib/texmfmp.c ptexd.h sed s/TEX-OR-MF-OR-MP/ptex/ $(srcdir)/lib/texmfmp.c >$@ ptexdir/ptexextra.h: ptexdir/ptexextra.in ptexdir/ptex.version sed s/PTEX-VERSION/`cat ptexdir/ptex.version`/ \ $(srcdir)/ptexdir/ptexextra.in >$@ # Tangling pTeX ptex.p ptex.pool: ptex-tangle @$(texmf_tangle) ptex ptex ptex-tangle: tangle$(EXEEXT) ptex.web ptex.ch tangle-sh @$(texmf_tangle) ptex ptex # Extract ptex version ptexdir/ptex.version: ptexdir/ptex-base.ch $(MKDIR_P) ptexdir/lib grep "^@d TeX_banner=='This is pTeX" $(srcdir)/ptexdir/ptex-base.ch \ | sed "s/^.*-//;s/'.*$$//" >ptexdir/ptex.version # Generate ptex.web ptex.web: tie$(EXEEXT) $(ptex_web_srcs) $(tie) -m ptex.web $(ptex_web_srcs) ptex_web_srcs = \ tex.web \ tex.ch # Generate ptex.ch ptex.ch: tie$(EXEEXT) ptex.web $(ptex_ch_srcs) $(tie) -c ptex.ch ptex.web $(ptex_ch_srcs) ptex_ch_srcs = \ $(ptex_ch_synctex) \ ptexdir/ptex-base.ch \ tex-binpool.ch EXTRA_DIST += $(ptex_web_srcs) $(ptex_ch_srcs) ptexdir/ptexextra.in \ ptexdir/ptex.defines lib/texmfmp.c tmf-pool.h DISTCLEANFILES += $(nodist_ptex_SOURCES) ptex.web ptex.ch ptex-web2c \ ptex.p ptex.pool ptex-tangle ptexdir/ptex.version ## pBibTeX ## nodist_pbibtex_SOURCES = pbibtex.c pbibtex.h pbibtex_SOURCES = ptexdir/kanji.h pbibtex_CPPFLAGS = $(ptex_cppflags) pbibtex_LDADD = $(ptex_ldadd) pbibtex.c pbibtex.h: pbibtex-web2c $(web2c) pbibtex pbibtex-web2c: pbibtex.p $(web2c_depend) ptexdir/ptex.defines web2c/cvtbib.sed $(web2c) pbibtex pbibtex.p: tangle$(EXEEXT) pbibtex.web ptexdir/pbibtex.ch $(p_tangle) pbibtex pbibtex pbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch $(tie) -m pbibtex.web bibtex.web bibtex.ch EXTRA_DIST += ptexdir/pbibtex.ch web2c/cvtbib.sed ## pDVItype ## nodist_pdvitype_SOURCES = pdvitype.c pdvitype.h pdvitype_SOURCES = ptexdir/kanji.h pdvitype_CPPFLAGS = $(ptex_cppflags) -DDHEX_CHAR_CODE pdvitype_LDADD = $(ptex_ldadd) pdvitype.c pdvitype.h: pdvitype-web2c $(web2c) pdvitype pdvitype-web2c: pdvitype.p $(web2c_depend) ptexdir/ptex.defines $(web2c) pdvitype pdvitype.p: tangle$(EXEEXT) pdvitype.web ptexdir/pdvitype.ch $(p_tangle) pdvitype pdvitype pdvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch $(tie) -m pdvitype.web dvitype.web dvitype.ch EXTRA_DIST += ptexdir/pdvitype.ch ## pPLtoTF ## nodist_ppltotf_SOURCES = ppltotf.c ppltotf.h ppltotf_SOURCES = ptexdir/kanji.h ppltotf_CPPFLAGS = $(ptex_cppflags) -DPRESERVE_PUTC ppltotf_LDADD = $(ptex_ldadd) ppltotf.c ppltotf.h: ppltotf-web2c $(web2c) ppltotf ppltotf-web2c: ppltotf.p $(web2c_depend) ptexdir/ptex.defines $(web2c) ppltotf ppltotf.p: tangle$(EXEEXT) ppltotf.web ptexdir/ppltotf.ch $(p_tangle) ppltotf ppltotf ppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch $(tie) -m ppltotf.web pltotf.web pltotf.ch EXTRA_DIST += ptexdir/ppltotf.ch ## pTFtoPL ## nodist_ptftopl_SOURCES = ptftopl.c ptftopl.h ptftopl_SOURCES = ptexdir/kanji.h ptftopl_CPPFLAGS = $(ptex_cppflags) ptftopl_LDADD = $(ptex_ldadd) ptftopl.c ptftopl.h: ptftopl-web2c $(web2c) ptftopl ptftopl-web2c: ptftopl.p $(web2c_depend) ptexdir/ptex.defines $(web2c) ptftopl ptftopl.p: tangle$(EXEEXT) ptftopl.web ptexdir/ptftopl.ch $(p_tangle) ptftopl ptftopl ptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch $(tie) -m ptftopl.web tftopl.web tftopl.ch EXTRA_DIST += ptexdir/ptftopl.ch ## EXTRA_DIST += \ ptexdir/COPYRIGHT \ ptexdir/COPYRIGHT.jis \ ptexdir/ChangeLog \ ptexdir/Changes.txt \ ptexdir/INSTALL.txt \ ptexdir/README.txt # pTeX Tests # ptex_tests = ptexdir/ptrip.test EXTRA_DIST += $(ptex_tests) if PTEX TESTS += $(ptex_tests) check_PROGRAMS += dvitype pltotf tftopl TRIPTRAP += ptrip.diffs endif PTEX DISTCLEANFILES += ptrip.diffs .PHONY: ptrip-clean clean-local:: ptrip-clean # ptrip.test ptrip-clean: rm -f trip.tfm trip.pl trip.tex trip.fmt ptripin.fot ptripin.log rm -f ptrip.fot ptrip.log trip.log trip.dvi trip.typ rm -f ptrip.fot ptrip.log ptrip.dvi ptrip.typ rm -f tripos.tex 8terminal.tex rm -rf tfm ## Test data ## EXTRA_DIST += ptexdir/ptrip.diffs ## Eventually delete these files ## EXTRA_DIST += \ ptexdir/Files \ ptexdir/pbibtex.defines \ ptexdir/ptex.mk \ ptexdir/ptex-base.ch.orig \ ptexdir/ptex-include.ch \ ptexdir/ptexhelp.h \ ptexdir/reautoconf