home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / web2c / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  14KB  |  482 lines

  1. # Makefile for web2c, a port of TeX, Metafont, and friends --karl@cs.umb.edu.
  2. version = 6.1
  3.  
  4. # The following make definitions (down to `end of installation
  5. # directories') are repeated in several Makefiles, because different
  6. # installations like to change them at different levels. If you edit the
  7. # top-level Makefile, the changes should propagate, however.
  8. # The following define installation directories. The default paths are
  9. # defined in kpathsea/paths.h, which is built from kpathsea/paths.h.in.
  10. # See kpathsea/INSTALL for a description of how the various path-related
  11. # files are used and created.
  12.  
  13. # Generic installation directories.
  14. prefix = @prefix@
  15. exec_prefix = @exec_prefix@
  16. bindir = $(exec_prefix)/bin
  17. scriptdir = $(bindir)
  18. libdir = $(exec_prefix)/lib
  19. datadir = $(prefix)/lib
  20. infodir = $(prefix)/info
  21. includedir = $(prefix)/include
  22. manext = 1
  23. mandir = $(prefix)/man/man$(manext)
  24.  
  25. # TeX & MF-specific directories. Not all of the following are relevant
  26. # for all programs, but it seems cleaner to collect everything in one place.
  27.  
  28. # The default paths are now in kpathsea/Makefile.in. Passing all the
  29. # paths to sub-makes can make the arg list too long on system V.
  30.  
  31. # The root of the tree.
  32. texmf_prefix = $(datadir)/texmf
  33.  
  34. # TeX and MF source files.
  35. texinputdir = $(texmf_prefix)/tex
  36. mfinputdir = $(texmf_prefix)/mf
  37.  
  38. # The top-level font directory.
  39. fontdir = $(texmf_prefix)/fonts
  40.  
  41. # Where memory dumps are installed.
  42. fmtdir = $(texmf_prefix)/ini
  43. basedir = $(fmtdir)
  44.  
  45. # Pool files.
  46. texpooldir = $(texmf_prefix)/ini
  47. mfpooldir = $(texpooldir)
  48.  
  49. # The PostScript TFM and VF files get installed in subdirectories of
  50. # this directory, named for the typeface families of these directories.
  51. psfontdir = $(fontdir)/adobe
  52.  
  53. # Where the configuration files get installed.
  54. dvips_prefix = $(texmf_prefix)/dvips
  55. configdir = $(dvips_prefix)
  56.  
  57. # Where the PostScript prologues go.
  58. headerdir = $(configdir)
  59.  
  60. # Where dvips' TeX macro files get installed.
  61. psmacrodir = $(texinputdir)/dvips
  62.  
  63. # If a font can't be found close enough to its stated size, we look for
  64. # each of these sizes in the order given.  This colon-separated list is
  65. # overridden by the envvar TEXSIZES, and by a program-specific variable
  66. # (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips).
  67. default_texsizes = 300:600
  68.  
  69. # End of installation directory definitions.
  70.  
  71. # These lines define the format and base files that `make fmts' and
  72. # `make bases' will try to make, and `make install-fmts' and `make
  73. # install-bases' will try to install.  See `README' for a brief
  74. # description of each of these formats.
  75. bases = mf.base cmmf.base
  76. fmts = tex.fmt latex.fmt
  77. # slitex.fmt etex.fmt amslatex.fmt amstex.fmt texinfo.fmt
  78. # inrstex.fmt picplus.fmt
  79.  
  80. # The name of the file that defines your local devices, for use with
  81. # Metafont.  (Only relevant during `make bases'.)  I urge you to get the
  82. # file `modes.mf', which defines all known modes, plus useful
  83. # definitions for all fonts.  It's available from ftp.cs.umb.edu as
  84. # pub/tex/modes.mf, among other places.
  85. localmodes = modes
  86.  
  87.  
  88. # Compilation options.
  89. DEFS = $(XDEFS)
  90.  
  91. # CFLAGS is used for both compilation and linking.
  92. CFLAGS = $(XCFLAGS)
  93.  
  94. # Do not override CPPFLAGS; change CFLAGS or DEFS instead.
  95. CPPFLAGS = $(XCPPFLAGS) -I. -I$(srcdir) -I$(kpathsea_parent) \
  96.            $(x_include_flags) $(DEFS) 
  97. .c.o:
  98.     $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
  99.  
  100. # Linking.
  101. LDFLAGS = $(CFLAGS) $(XLDFLAGS)
  102. LOADLIBES = $(kpathsea) $(x_libs) $(LIBS) -lm $(x_extra_libs)
  103.  
  104. # This is so kpathsea will get remade automatically if you change
  105. # something in it and recompile from the package directory.
  106. kpathsea_parent = ..
  107. kpathsea_dir = $(kpathsea_parent)/kpathsea
  108. kpathsea_srcdir_parent = $(srcdir)/..
  109. kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
  110. kpathsea = $(kpathsea_dir)/kpathsea.a
  111.  
  112. CC = @CC@
  113.  
  114. LEX = @LEX@
  115. LEXLIB = @LEXLIB@
  116. YACC = @YACC@
  117.  
  118. # Command to link an executable.
  119. CCLD = $(CC)
  120. RANLIB = @RANLIB@
  121. LN = @LN_S@
  122.  
  123. # Make `#include <X11/...>' and `-lX...' work.
  124. # wlibs is substituted by web2c's configure, LIBS by general configure
  125. # routines, and the others by AC_PATH_XTRA.
  126. x_include_flags = @X_CFLAGS@
  127. x_lib_flags = @X_LIBS@
  128. x_extra_libs = @X_EXTRA_LIBS@
  129. wlibs = @wlibs@
  130. LIBS = @LIBS@ $(extralibs)
  131.  
  132. INSTALL = @INSTALL@
  133. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  134. INSTALL_DATA = @INSTALL_DATA@
  135.  
  136. SHELL = /bin/sh
  137. srcdir = @srcdir@
  138. VPATH = @srcdir@
  139.  
  140.  
  141. # Things below here not changed by configure.
  142.  
  143. # What to do by default.
  144. default: programs
  145. .PHONY: default
  146.  
  147. # Where we need to make things.
  148. triptrapdirs = dviutil fontutil
  149. progdirs = $(triptrapdirs) tex mf bibtex web
  150. alldirs = $(progdirs) lib man web2c
  151.  
  152. # What to pass to subdirectories when making various things.
  153. # $(MAKEARGS) is for the user.
  154. makeargs=$(MFLAGS) SHELL='$(SHELL)' CC='$(CC)' CFLAGS='$(CFLAGS)'    \
  155.   RANLIB='$(RANLIB)' LN='$(LN)' DEFS='$(DEFS)'                          \
  156.   CCLD='$(CCLD)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)'             \
  157.   x_extra_libs='$(x_extra_libs)' x_include_flags='$(x_include_flags)'    \
  158.   x_lib_flags='$(x_lib_flags)' $(MAKEARGS) 
  159. web2cmakeargs=$(makeargs) YACC='$(YACC)' LEX='$(LEX)' LEXLIB='$(LEXLIB)'
  160. installargs=$(makeargs)                         \
  161.   INSTALL_DATA='$(INSTALL_DATA)'                    \
  162.   INSTALL_PROGRAM='$(INSTALL_PROGRAM)'                    \
  163.   bindir=$(bindir)                            \
  164.   fontdir=$(fontdir)                            \
  165.   texpooldir=$(texpooldir)                        \
  166.   mfpooldir=$(mfpooldir)
  167.  
  168.  
  169. # The TeX and Metafont torture tests.
  170. triptrap: trip trap
  171. .PHONY: triptrap
  172.  
  173. common-trip: do-tangle
  174.     for name in $(triptrapdirs); do                    \
  175.           (cd $${name}; $(MAKE) $(makeargs) triptrap); done
  176.  
  177. check run-triptrap: run-trip run-trap
  178. .PHONY: check run-triptrap
  179.  
  180. clean-triptrap: clean-trip clean-trap
  181. .PHONY: clean-triptrap
  182.  
  183.  
  184. run-trip: trip
  185.     cd tex; $(MAKE) $(makeargs) run-trip
  186. .PHONY: run-trip
  187.  
  188. trip: common-trip
  189.     cd tex; $(MAKE) $(makeargs) triptrap
  190. .PHONY: trip
  191.  
  192. clean-trip: 
  193.     cd tex; $(MAKE) clean-trip
  194. .PHONY: clean-trip
  195.  
  196.  
  197. run-trap: trap
  198.     cd mf; $(MAKE) $(makeargs) run-trap
  199. .PHONY: run-trap
  200.  
  201. trap: common-trip
  202.     cd mf; $(MAKE) $(makeargs) triptrap
  203. .PHONY: trap
  204.  
  205. clean-trap:
  206.     cd mf; $(MAKE) clean-trap
  207. .PHONY: clean-trap
  208.  
  209.  
  210. # The following targets build production TeX and MF.
  211.  
  212. all: programs manpages formats
  213. .PHONY: all
  214.  
  215. programs: do-tangle
  216.     for d in $(progdirs); do (cd $$d; $(MAKE) $(makeargs) all); done
  217. .PHONY: programs
  218.  
  219. TeX:    do-tangle
  220.     cd tex; $(MAKE) $(makeargs) all
  221. .PHONY: TeX
  222.  
  223. MF:    do-tangle
  224.     cd mf; $(MAKE) $(makeargs) all
  225. .PHONY: MF
  226.  
  227. BibTeX: do-tangle
  228.     cd bibtex; $(MAKE) $(makeargs) all
  229. .PHONY: BibTeX
  230.  
  231.  
  232. do-tangle: do-web2c
  233.     cd web; $(MAKE) $(makeargs) tangle
  234. .PHONY: do-tangle
  235.  
  236. do-web2c: do-kpathsea do-lib
  237.     cd web2c; $(MAKE) $(web2cmakeargs) all
  238. .PHONY: do-web2c
  239.  
  240. do-kpathsea: $(kpathsea_srcdir)/*.c $(kpathsea_srcdir)/*.h
  241.     cd $(kpathsea_dir); $(MAKE) $(makeargs)
  242. .PHONY: do-kpathsea
  243.  
  244. do-lib: $(srcdir)/lib/*.c
  245.     cd lib; $(MAKE) $(makeargs) all
  246. .PHONY: do-lib
  247.  
  248.  
  249. c-sources: do-tangle
  250.     for d in $(progdirs); do (cd $$d; $(MAKE) $(makeargs) c-sources); done
  251. .PHONY: c-sources
  252.  
  253. manpages: $(kpathsea_dir)/paths.h
  254.     cd man; $(MAKE) bindir=$(bindir) texdatadir=$(texdatadir)    \
  255.         texpooldir=$(texpooldir) fmtdir=$(fmtdir)        \
  256.         texinputdir=$(texinputdir) fontdir=$(fontdir)        \
  257.         mfdatadir=$(mfdatadir) mfpooldir=$(mfpooldir)        \
  258.         basedir=$(basedir) mfinputdir=$(mfinputdir)        \
  259.                 localmodes='$(localmodes)'                \
  260.                 all
  261. .PHONY: manpages
  262.  
  263. formats: bases fmts
  264. .PHONY: formats
  265.  
  266. bases: MF
  267.     cd mf; \
  268.           $(MAKE) $(makeargs) bases="$(bases)" localmodes='$(localmodes)' bases
  269. .PHONY: bases
  270.  
  271. fmts: TeX
  272.     cd tex; $(MAKE) $(makeargs) fmts="$(fmts)" fmts
  273. .PHONY: fmts
  274.  
  275.  
  276. # Installation targets.
  277.  
  278. install: install-exec install-data
  279. .PHONY: install
  280. install-data: install-fmts install-bases install-manpages
  281.     for name in $(progdirs); do                    \
  282.           (cd $${name}; $(MAKE) $(installargs) install-data);        \
  283.         done
  284. .PHONY: install-data
  285.  
  286. install-exec: programs
  287.     $(SHELL) $(srcdir)/../mkdirchain $(bindir)
  288.     for name in $(progdirs); do                    \
  289.           (cd $${name}; $(MAKE) $(installargs) install-exec);        \
  290.         done
  291.     for f in $(fmts); do                        \
  292.       rm -f $(bindir)/`basename $$f .fmt`;                \
  293.           cp -p $(bindir)/virtex $(bindir)/`basename $$f .fmt`;        \
  294.     done
  295.     for f in $(bases); do                        \
  296.       rm -f $(bindir)/`basename $$f .base`;                \
  297.       cp -p $(bindir)/virmf $(bindir)/`basename $$f .base`;        \
  298.     done
  299. .PHONY: install-exec
  300.  
  301. install-fmts: fmts
  302.     $(SHELL) $(srcdir)/../mkdirchain $(fmtdir)
  303.     for f in $(fmts); do                        \
  304.           $(INSTALL_DATA) tex/$$f $(fmtdir)/$$f;            \
  305.     done
  306.     cd $(fmtdir); rm -f plain.fmt; cp -p tex.fmt plain.fmt
  307. .PHONY: install-fmts
  308.  
  309. install-bases: bases
  310.     $(SHELL) $(srcdir)/../mkdirchain $(basedir)
  311.     for f in $(bases); do                        \
  312.           $(INSTALL_DATA) mf/$$f $(basedir)/$$f;            \
  313.     done
  314.     cd $(basedir); rm -f plain.base; cp -p mf.base plain.base
  315. .PHONY: install-bases
  316.  
  317. install-manpages: manpages
  318.     cd man; $(MAKE) $(installargs)                    \
  319.            mandir=$(mandir) manext=$(manext) install
  320. .PHONY: install-manpages
  321.  
  322.  
  323. # Other targets.
  324.  
  325.  
  326. # We can't make useful tags files out of the web sources, more's the pity.
  327. TAGS:
  328.  
  329. # Prevent GNU make 3 from overflowing arg limit on system V.
  330. .NOEXPORT:
  331.  
  332. # Need GNU tar for this.
  333. distname = web2c
  334. program_files = PROBLEMS
  335. program_rm = */Makefile
  336. version_files = lib/version.c
  337.  
  338. pre-dist-$(distname):
  339.     cd lib; $(MAKE) c-auto.h.in
  340.     cd web2c; $(MAKE) lex.yy.c y.tab.c
  341.     cd web; $(MAKE) tangleboot.c
  342. # Save the subdir list for the next command.
  343.     find * -type d -print | sed '/$(top_distdir)/d' >/tmp/subdir
  344.  
  345. post-dist-$(distname):
  346. # Make the subdirectories.
  347.     for d in `cat /tmp/subdir`; do \
  348.       mkdir -p $(top_distdir)/$(distname)/$$d; done
  349. #
  350. # Link files in subdirectories.
  351.     dirs="`grep -v / /tmp/subdir`";         \
  352.     for f in `find $$dirs                   \
  353.                        \(    -name README       \
  354.                           -o -name .gdbinit     \
  355.                           -o -name ChangeLog    \
  356.                           -o -name MakeTeX\*    \
  357.                           -o -name convert      \
  358.                           -o -name tr\*penv     \
  359.                           -o -name \*.add       \
  360.                           -o -name \*.ch        \
  361.                           -o -name \*.defines   \
  362.                           -o -name \*.in        \
  363.                           -o -name \*.lex       \
  364.                           -o -name \*.man       \
  365.                           -o -name \*.map       \
  366.                           -o -name \*.sed       \
  367.                           -o -name \*.sok       \
  368.                           -o -name \*.start     \
  369.                           -o -name \*.yacc      \
  370.                        \) -print`; do           \
  371.           cp -p $$f $(distdir)/`dirname $$f`;    \
  372.         done
  373.     cp -p lib/*.c lib/*.h $(distdir)/lib
  374.     rm -f lib/c-auto.h
  375.     cp -p mf/MFwindow/*.c $(distdir)/mf/MFwindow
  376.     rm -f mf/MFwindow/x11.c mf/MFwindow/sun.c
  377.     cp -p mf/MFtrap/trap.* mf/MFtrap/trapin.log mf/MFtrap/trapman.tex \
  378.       $(distdir)/mf/MFtrap
  379.     cp -p fontutil/gftodmem.h $(distdir)/fontutil
  380.     cp -p tex/TeXtrip/trip.* tex/TeXtrip/tripin.log \
  381.            tex/TeXtrip/tripman.tex tex/TeXtrip/tripos.tex \
  382.       $(distdir)/tex/TeXtrip
  383.     for d in tex mf bibtex; do rm -f $(distdir)/$$d/c$$d.ch; done
  384.     cp -p web/tangleboot.* $(distdir)/web
  385.     rm -f $(distdir)/web/tangleboot.o
  386.     cp -p web2c/*.c web2c/*.h $(distdir)/web2c
  387.     (cd $(distdir)/web2c; mv y.tab.c y.tab.c-dist; \
  388.       mv y.tab.h y.tab.h-dist; \
  389.       mv lex.yy.c lex.yy.c-dist)
  390.     cd $(distdir); ungnumake */Makefile.in */*/Makefile.in
  391. top_distdir = $(distname)-$(version)
  392. top_files = ChangeLog Makefile.in configure configure.in README \
  393.   $(HOME)/gnu/gnuorg/COPYING* $(HOME)/bin/mkdirchain \
  394.   $(plain)/texinfo.tex
  395. distdir = $(top_distdir)/$(distname)
  396. kpathsea_distdir = ../$(distname)/$(top_distdir)/kpathsea
  397. ln_files = AUTHORS ChangeLog INSTALL MACHINES NEWS README TAGS *.in *.h *.c \
  398.   configure *.make .gdbinit
  399.  
  400. dist: pre-dist-$(distname)
  401.     rm -rf $(top_distdir)*
  402.     mkdir -p $(distdir)
  403.     cd ..; cp -p $(top_files) $(distname)/$(top_distdir)
  404.     cd ..; echo >>$(distname)/$(top_distdir)/ChangeLog
  405.     cd ..; cat kutil/ChangeLog >>$(distname)/$(top_distdir)/ChangeLog
  406.     -cp -p $(ln_files) $(distdir)
  407.     cp -p $(program_files) $(distdir)
  408.     cd $(kpathsea_dir); $(MAKE) distdir=$(kpathsea_distdir) \
  409.       ln_files='$(ln_files)' distdir
  410.     ungnumake $(distdir)/Makefile.in $(kpathsea_distdir)/Makefile.in \
  411.       $(top_distdir)/Makefile.in
  412. # *.make gets us depend.make.
  413.     rm -f $(distdir)/*.make $(kpathsea_distdir)/*.make
  414.     cd $(distdir); rm -f c-auto.h $(program_rm)
  415.     $(MAKE) post-dist-$(distname)
  416.     cd $(distdir); add-version $(version) $(version_files)
  417.     chmod -R a+rw $(top_distdir)
  418.     GZIP=-9 tar czf $(top_distdir). $(top_distdir)
  419.     rm -rf $(top_distdir)
  420.  
  421.  
  422.  
  423. # I define $(autoconf) to acgeneral.m4 and the other Autoconf files, so
  424. # configure automatically gets remade with a new Autoconf release.  But
  425. # since some people do not have AC installed, I take out the variable
  426. # $(autoconf) definition before release.
  427. configure_in = $(srcdir)/configure.in $(srcdir)/../kpathsea/common.ac
  428. $(srcdir)/configure: $(configure_in) $(autoconf)
  429.     cd $(srcdir); autoconf
  430.  
  431. config.status: $(srcdir)/configure
  432.     $(SHELL) $(srcdir)/configure --no-create --verbose
  433.  
  434. Makefile: $(srcdir)/Makefile.in config.status
  435.     $(SHELL) config.status
  436.  
  437. # This rule isn't used for web2c or the top-level Makefile, but it
  438. # doesn't hurt.  We don't depend on config.status because configure
  439. # always rewrites config.status, even when it doesn't change. Thus it
  440. # might be newer than c-auto.h when we don't need to remake the latter.
  441. c-auto.h: $(srcdir)/c-auto.h.in
  442.     $(SHELL) config.status
  443.  
  444. web-dist:
  445.     rm -rf $(top_distdir)
  446.     mkdir -p $(top_distdir)/$(distname)
  447.     cd $(top_distdir)/$(distname); \
  448.           mkdir `cd ../..; find -name \*.web -exec dirname '{}' \; | uniq`
  449.     for d in `find . -name $(distdir) -prune -o -name \*.web -print` ; do\
  450.           cp -p $$d $(distdir)/`dirname $$d`;                \
  451.         done
  452.     GZIP=-9 tar czf web-$(version). $(top_distdir)
  453.     rm -rf $(top_distdir)
  454.  
  455. web/tangleboot.c:
  456.     cd web; $(MAKE) tangleboot.c
  457.  
  458.  
  459. mostlyclean clean distclean extraclean realclean::
  460.     for name in $(alldirs); do (cd $${name}; $(MAKE) $@); done
  461.  
  462. realclean distclean::
  463.     rm -f Makefile config.status config.log config.cache
  464.  
  465. extraclean::
  466.     rm -f *~ *\#* patch* *.orig *.rej core a.out *.i *.s
  467.     rm -f *log *gf *pk *.tfm *.pl *.dvi
  468.  
  469. configclean:
  470.     rm -f configure lib/c-auto.h.in lib/c-auto.h
  471.  
  472. # Local variables:
  473. # page-delimiter: "^# \f"
  474. # End:
  475.