1 # $Id: Makefile.in 8409 2008-05-29 20:59:08Z karl $
3 # Makefile for kpathsea. Public domain.
4 version = @KPSEVERSION@
6 # Add -DNO_DEBUG to disable debugging, for vanishingly better performance.
8 kpse_include ../make/paths.mk
9 kpse_include ../make/makevars.mk
10 kpse_include ../make/common.mk
11 kpse_include ../make/library.mk
12 kpse_include ../make/programs.mk
13 kpse_include ../make/texi.mk
15 @MAINT@warn_more = -Wmissing-prototypes -Wwrite-strings -Wshadow
16 @MAINT@MAKEINFO_FLAGS := $(MAKEINFO_FLAGS) --no-split
18 # Install these header files (except acconfig.h).
19 install_headers = *.h $(srcdir)/*.h
21 # Put tex-file.o first, because it's what depends on the paths, and may
22 # reduce frustration if the paths are wrong by doing it first.
24 objects = tex-file.lo absolute.lo atou.lo cnf.lo concat.lo concat3.lo \
25 concatn.lo db.lo debug.lo dir.lo elt-dirs.lo expand.lo extend-fname.lo \
26 file-p.lo find-suffix.lo fn.lo fontmap.lo getopt.lo getopt1.lo hash.lo \
27 kdefault.lo line.lo magstep.lo make-suffix.lo path-elt.lo \
28 pathsearch.lo proginit.lo progname.lo readable.lo rm-suffix.lo \
29 str-list.lo str-llist.lo tex-glyph.lo tex-hush.lo tex-make.lo \
30 tilde.lo truncate.lo uppercasify.lo variable.lo version.lo xbasename.lo \
31 xcalloc.lo xdirname.lo xfopen.lo xfseek.lo xfseeko.lo xftell.lo xftello.lo xgetcwd.lo xmalloc.lo \
32 xopendir.lo xputenv.lo xrealloc.lo xstat.lo xstrdup.lo $(liblobjs) $(malloc) \
33 error.lo filename.lo home.lo lookcmd.lo string.lo system.lo time.lo user.lo \
35 liblobjs = @LTLIBOBJS@
39 # We want to compile almost everything with libtool ...
40 KPATHSEA_CC = $(LIBTOOL) --mode=compile $(CC)
43 $(KPATHSEA_CC) $(ALL_CFLAGS) -DMAKE_KPSE_DLL -c $<
45 default all: kpsewhich kpsestat kpseaccess kpsereadlink $(library).info manfiles
47 kpsewhich: $(kpathsea) kpsewhich.o
48 $(kpathsea_link) kpsewhich.o $(LOADLIBES)
51 $(link_command) kpsestat.o
54 $(link_command) access.o
56 kpsereadlink: readlink.o
57 $(link_command) readlink.o
59 $(kpathsea): $(objects)
60 $(kpathsea_link) -rpath $(libdir) -version-info @KPSE_LT_VERS@ $(objects)
62 # First null out comments and leading/trailing whitespace, then remove
63 # lines that define invalid C identifiers, then remove blank lines and
64 # lines that define lowercase values (those are never path values). Each
65 # line remaining looks like
67 # (but = and surrounding spaces are optional, hence can't remove all spaces).
68 # Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif,
69 # then change the @'s to newlines (sed isn't good at multiline replacements).
71 # No backslash-newline escapes in the long sed replacement because that
72 # will turn into a space in the output.
74 # We replace the $TEXMF* references with nonexisting directories. These
75 # are the compile-time defaults and are not useful in the native TL
76 # builds; we rely completely on the self-location. (Previously, the
77 # random build-time paths would get included in the binaries, to
78 # consequent confusion.)
80 # We preserve the $SELFAUTO* references, since the selfauto-using
81 # compile-time path for cnf files is how texmf.cnf gets found, which
82 # determines everything else.
84 # The definition of DEFAULT_TEXMF (and other variables)
85 # that winds up in the final paths.h will not be used.
87 # We don't want to rewrite paths.h when we have only changed comments
88 # in texmf.cnf that have no effect on paths.h, since that would cause
89 # almost everything to be rebuilt.
91 # We also replace all semicolons with colons in the paths.
92 # The path-splitting code should be changed to understand both.
94 $(kpathsea_dir)/paths.h: stamp-paths
95 stamp-paths: $(srcdir)/texmf.cnf
96 echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp
97 sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' $(srcdir)/texmf.cnf \
98 | grep '^[ ]*[A-Z0-9_]*[ =]' \
100 | sed 's/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1%#define DEFAULT_\1 "\2"%#endif/' \
102 | sed -e 's%\$$TEXMFCONFIG%/nonesuch/texmfconfig%g' \
103 -e 's%\$$TEXMFDIST%/nonesuch/texmfdist%g' \
104 -e 's%\$$TEXMFDOCDIR%/nonesuch/texmfdocdir%g' \
105 -e 's%\$$TEXMFLOCAL%/nonesuch/texmflocal%g' \
106 -e 's%\$$TEXMFMAIN%/nonesuch/texmfmain%g' \
107 -e 's%\$$TEXMFSYSCONFIG%/nonesuch/texmfsysconfig%g' \
108 -e 's%\$$TEXMFSYSVAR%/nonesuch/texmfsysvar%g' \
109 -e 's%\$$TEXMFVAR%/nonesuch/texmfvar%g' \
110 -e 's%\$$TEXMF%/nonesuch/texmf%g' \
111 -e 's%\$$VARTEXFONTS%/nonesuch/vartexfonts%g' \
114 @if cmp -s paths.h paths.tmp 2>/dev/null; then \
115 echo "paths.h is unchanged"; \
117 echo "cp paths.tmp paths.h"; \
118 cp paths.tmp paths.h; \
123 # Need an extra definition for this. Dependencies included below.
125 $(KPATHSEA_CC) -DDEFAULT_FONT_SIZES='\"$(default_texsizes)\"' $(srcdir)/tex-file.c
128 ./kpsewhich -expand-var '$$TEXMF'
130 install: install-exec install-data
131 uninstall: uninstall-exec uninstall-data
133 install-exec: kpsewhich
134 $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir) \
135 $(libdir) $(web2cdir)
136 if grep 'original mktexpk --' $(scriptdir)/mktexpk >/dev/null 2>&1\
137 || test ! -r $(scriptdir)/mktexpk; then \
138 $(INSTALL_SCRIPT) $(srcdir)/mktexpk $(scriptdir)/mktexpk; \
140 if grep 'original mktexmf --' $(scriptdir)/mktexmf >/dev/null 2>&1\
141 || test ! -r $(scriptdir)/mktexmf; then \
142 $(INSTALL_SCRIPT) $(srcdir)/mktexmf $(scriptdir)/mktexmf; \
144 if grep 'original mktextfm --' $(scriptdir)/mktextfm >/dev/null 2>&1\
145 || test ! -r $(scriptdir)/mktextfm; then \
146 $(INSTALL_SCRIPT) $(srcdir)/mktextfm $(scriptdir)/mktextfm; \
148 if grep 'original mktexlsr --' $(scriptdir)/mktexlsr >/dev/null 2>&1\
149 || test ! -r $(scriptdir)/mktexlsr; then \
150 $(INSTALL_SCRIPT) $(srcdir)/mktexlsr $(scriptdir)/mktexlsr; \
152 $(INSTALL_DATA) $(srcdir)/mktex.opt $(web2cdir)/mktex.opt
153 $(INSTALL_SCRIPT) $(srcdir)/mktexdir $(web2cdir)/mktexdir
154 $(INSTALL_DATA) $(srcdir)/mktexdir.opt $(web2cdir)/mktexdir.opt
155 $(INSTALL_SCRIPT) $(srcdir)/mktexnam $(web2cdir)/mktexnam
156 $(INSTALL_DATA) $(srcdir)/mktexnam.opt $(web2cdir)/mktexnam.opt
157 $(INSTALL_SCRIPT) $(srcdir)/mktexupd $(web2cdir)/mktexupd
158 $(INSTALL_LIBTOOL_LIBS) lib$(library).la $(libdir)
159 $(INSTALL_LIBTOOL_PROG) kpsewhich $(bindir)
160 $(INSTALL_PROGRAM) kpsestat $(bindir)
161 $(INSTALL_PROGRAM) kpseaccess $(bindir)
162 $(INSTALL_PROGRAM) kpsereadlink $(bindir)
164 $(UNINSTALL_LIBTOOL_LIBS) $(libdir)/lib$(library).la
165 $(UNINSTALL_LIBTOOL_PROG) $(bindir)/kpsewhich
166 $(UNINSTALL_PROGRAM) $(bindir)/kpsestat
167 $(UNINSTALL_PROGRAM) $(bindir)/kpseaccess
168 $(UNINSTALL_PROGRAM) $(bindir)/kpsereadlink
170 install-data: $(srcdir)/texmf.cnf kpathsea.info install-man
171 $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf) $(infodir) $(web2cdir)
172 if grep 'original texmf.cnf --' $(web2cdir)/texmf.cnf >/dev/null 2>&1 \
173 || test ! -r $(web2cdir)/texmf.cnf; then \
174 $(INSTALL_DATA) $(srcdir)/texmf.cnf $(web2cdir)/texmf.cnf; \
177 $(INSTALL_DATA) $(srcdir)/kpathsea.i* $(infodir)/
178 # Should we install the headers? They are not just system-dependent,
179 # which is bad enough, but even compiler-dependent.
180 $(SHELL) $(top_srcdir)/../mkinstalldirs $(includedir)/kpathsea
181 for f in $(install_headers); do \
182 $(INSTALL_DATA) $$f $(includedir)/kpathsea/; done
183 rm -f $(includedir)/kpathsea/acconfig.h
186 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
187 install-info --info-dir=$(infodir) $(infodir)/kpathsea.info; \
192 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
193 install-info --delete --info-dir=$(infodir) $(infodir)/kpathsea.info; \
196 rm -f $(infodir)/kpathsea.i*
197 # for f in $(install_headers); do rm -f $(includedir)/`basename $$f`; done
199 # distdir is used by other distributions; they define $(distdir).
200 distdir: doc $(library).dvi $(library).h
203 ln $(ln_files) $(distdir)
205 ln mktex* *.info* *.texi *.ftp $(library).aux $(library).cps $(distdir)
206 rm -f $(distdir)/*.1 $(distdir)/*.man
208 ln BUGS README.CONFIGURE HIER PROJECTS *.ac $(distdir)
209 touch kpathsea.h # to avoid .cps.h rule on Solaris
210 cd $(distdir) && rm -f paths.h
212 # I don't use this, but other programmers want it. acconfig.h is an
213 # autoheader input file, not an includable C header. Bad name.
216 echo '/* This is a generated file */' >$@
217 echo '/* collecting all kpathsea headers. */' >>$@
218 echo '#include <kpathsea/config.h>' >>$@
220 | grep -v '\(acconfig\|config\|kpathsea\|win32lib\)\.h' \
221 | sed -e 's,^,#include <kpathsea/,' -e s',$$,>,' >>$@
222 touch -r `ls -1t *.h | tail +2 | head -1` $@
226 kpse_include ../make/config.mk
228 info: $(library).info
231 $(library).info: bugs.texi hier.texi install.texi unixtex.texi
233 @MAINT@INSTALL: install.texi
234 @MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
235 @MAINT@ $(top_srcdir)/../add-info-toc $@
236 @MAINT@BUGS: bugs.texi
237 @MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
238 @MAINT@ $(top_srcdir)/../add-info-toc $@
239 @MAINT@HIER: hier.texi
240 @MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
241 @MAINT@unixtex.ftp: unixtex.texi
242 @MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
243 @MAINT@doc: info HIER BUGS INSTALL unixtex.ftp
245 kpse_include ../make/clean.mk
248 rm -f kpsewhich kpsestat kpseaccess kpsereadlink *.lo
249 $(LIBTOOL) --mode=clean $(RM) lib$(library).la
251 rm -f paths.h stamp-paths
254 manfiles = kpseaccess.1 kpsestat.1 kpsewhich.1 kpsereadlink.1 \
255 mktexlsr.1 mktexmf.1 mktextfm.1 mktexpk.1
257 kpse_include ../make/man.mk
259 kpse_include ../make/rdepend.mk
260 kpse_include depend.mk