# Master GNU makefile for font utilities. # # Copyright (C) 1992, 93, 2004, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Version number of this release. version = @PACKAGE_VERSION@ DESTDIR = # Installation prefixes. Since GNU programs and the TeX system may be # installed in different places, we have different prefixes. prefix = @prefix@ exec_prefix = @exec_prefix@ texmf_prefix = $(prefix) # Installation directories. bindir = @bindir@ infodir = @infodir@ datadir = @datadir@ fu_datadir = $(datadir)/fontutil emacs_datadir = $(datadir)/emacs # Emacs 18 and Emacs 19 both have different directories for this. emacslispdir = $(emacs_datadir)/elisp # Where to install .el files. mfdatadir = $(texmf_prefix)/lib/mf mfinputdir = $(mfdatadir)/macros texdatadir = $(texmf_prefix)/lib/tex texinputdir = $(texdatadir)/macros # Where the default resource files for X programs get installed. If you # don't want to or can't write in the standard app-defaults directory, # you can set this to any directory you like as long as you set the # XAPPLRESDIR environment variable to the same directory. See the # tutorial on resources in the X distribution # (.../mit/doc/tutorial/resources.txt) for more information. app_defaults = $(prefix)/lib/app-defaults # Default paths for you to override. You can either change these and # run `make', or copy include/paths.h.in to include/paths.h and change # them manually. These paths are overridden by various environment # variables; see the documentation. The font paths here should probably # match TeX's default paths. default_lib_path = .:$(shell pwd)/data:$(fu_datadir) default_tfm_path = .:$(texdatadir)/fonts// default_pk_path = $(default_tfm_path) default_gf_path = $(default_tfm_path) SHELL = @SHELL@ srcdir = @srcdir@ VPATH = @srcdir@ xincdir = @x_includes@ xlibdirp = @x_libraries@ # Compiler option for #include , i.e., should start with `-I', # or -DX_DISPLAY_MISSING if X is not supported. xincludedir = -I $(xincdir) # Loader option for -lX..., i.e., should start with `-L'. xlibdir = -L $(xlibdirp) CC = @CC@ CFLAGS = @CFLAGS@ # Need DEFS to get -DHAVE_CONFIG_H. It's included in CPPFLAGS via # data/defs.make. DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ $(xlibdir) $(CFLAGS) $(XLDFLAGS) LIBS = @LIBS@ -lm $(extralibs) wlibs = @wlibs@ RANLIB = @RANLIB@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ # You shouldn't need to change anything below here. # If X is not supported, don't try to make the widget library or the # bitmap editor. # ifeq "$(xincludedir)" "-DX_DISPLAY_MISSING" widgets = xbfe = else widgets = widgets xbfe = xbfe endif libraries = $(srcdir)/gf $(srcdir)/lib $(srcdir)/pbm $(srcdir)/pk $(srcdir)/tfm programs = $(srcdir)/charspace $(srcdir)/fontconvert $(srcdir)/imageto alldirs = $(libraries) $(programs) $(srcdir)/doc default: all .PHONY: all install libraries clean distclean extraclean realclean depend dist ifeq "$(xincdir)" "" ifeq "$(xlibdirp)" "" makeargs = $(MFLAGS) \ SHELL="$(SHELL)" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ LIBS="$(LIBS)" RANLIB="$(RANLIB)" srcdir=$(srcdir) \ wlibs="$(wlibs)" widgets="$(widgets)" endif else makeargs = $(MFLAGS) \ SHELL="$(SHELL)" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ LIBS="$(LIBS)" RANLIB="$(RANLIB)" srcdir=$(srcdir) \ wlibs="$(wlibs)" xlibdir="$(xlibdir)" xincludedir="$(xincludedir)" \ widgets="$(widgets)" endif all: libraries for dir in $(programs); \ do \ (cd $${dir}; $(MAKE) $(makeargs) all); \ done libraries: include/paths.h for dir in $(libraries); \ do \ (cd $${dir}; $(MAKE) $(makeargs)); \ done include/paths.h: include/paths.h.in GNUmakefile GNUmakefile.in rm -f $@ echo "/* Generated from paths.h.in (`date`). */" > $@ sed -e "s,replace-with-lib-path,$(default_lib_path)," \ -e "s,replace-with-tfm-path,$(default_tfm_path)," \ -e "s,replace-with-pk-path,$(default_pk_path)," \ -e "s,replace-with-gf-path,$(default_gf_path)," \ $< >> $@ installargs = bindir=$(DESTDIR)$(bindir) \ fu_datadir=$(DESTDIR)$(fu_datadir) \ emacslispdir=$(DESTDIR)$(emacslispdir) \ mfinputdir=$(DESTDIR)$(mfinputdir) \ texinputdir=$(DESTDIR)$(texinputdir) \ app_defaults=$(DESTDIR)$(app_defaults) \ kpathsea_parent=/usr/include/kpathsea \ kpathsea=/usr/lib/libkpathsea.a \ CFLAGS="$(CFLAGS)" \ INSTALL="$(INSTALL)" \ INSTALL_DATA="$(INSTALL_DATA)" \ INSTALL_PROGRAM="$(INSTALL_PROGRAM)" installdirs: mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(infodir) mkdir -p $(DESTDIR)$(fu_datadir) mkdir -p $(DESTDIR)$(emacslispdir) mkdir -p $(DESTDIR)$(app_defaults) mkdir -p $(DESTDIR)$(texdatadir) mkdir -p $(DESTDIR)$(texinputdir) install: installdirs for dir in $(programs) doc; do \ (cd $${dir}; $(MAKE) $(installargs) install); \ done cd data; for f in *.enc *.map common.cmi; do \ $(INSTALL_DATA) $$f $(DESTDIR)$(fu_datadir); done configure: configure.in cd $(srcdir); autoconf config.status: configure cd $(srcdir); $(SHELL) configure --no-create GNUmakefile: $(srcdir)/GNUmakefile.in config.status $(SHELL) config.status include/c-auto.h.in: configure.in #kp ../kpathsea/common.ac autoheader # Prevent GNU make 3 from overflowing arg limit on system V. .NOEXPORT: # Files in the top level directory to be distributed. topfiles = AUTHORS ChangeLog NEWS README configure *.in # Directories whose complete contents (almost) are to be distributed. completedirs = bin data include # Files which have version number or date templates. versionfiles = gsrenderfont/gsrf.in */version.c top_distdir = fontutils-$(version) distargs = top_distdir=$(top_distdir) app_defaults=$(app_defaults) \ version=$(version) srcdir=$(srcdir) dist:: # TAGS # depend rm -rf $(top_distdir) -mkdir $(top_distdir) # Set up the top-level files. ln $(topfiles) $(top_distdir) cp -p $(HOME)/gnu/gnuorg/COPYING* $(top_distdir) cp -p $(gnu)/lib/aclocal.m4 $(top_distdir) # Set up the directories whose complete contents get distributed. cd $(top_distdir); for dir in $(completedirs); do \ (mkdir $$dir; ln ../$$dir/* $$dir); done cp -p $(HOME)/bin/mkdirchain $(top_distdir)/bin cp -p $(plain)/testfont.tex $(top_distdir)/data cp -p $(ktex)/macros/printeps.tex $(top_distdir)/data rm -f $(top_distdir)/include/c-auto.h $(top_distdir)/include/paths.h # Set up the other subdirectories. for dir in $(alldirs); do \ (cd $$dir; $(MAKE) $(distargs) dir=$$dir dist) done # Add version numbers. Have to do this after creating the # $(versionfiles), naturally. cd $(top_distdir); add-version $(version) $(versionfiles) GZIP=-9 tar czf $(top_distdir). $(top_distdir) # Put the new info files in the local directory. cp -pf $(top_distdir)/doc/fontu.info* $(info) rm -rf $(top_distdir) TAGS: for dir in $(programs); \ do \ (cd $${dir}; $(MAKE) $@); \ done depend: include/paths.h for dir in $(alldirs); \ do \ (cd $${dir}; $(MAKE) $@); \ done mostlyclean clean distclean extraclean realclean:: for dir in $(alldirs); \ do \ (cd $${dir}; $(MAKE) $@); \ done distclean:: rm -f include/c-auto.h include/paths.h config.status GNUmakefile realclean:: distclean extraclean:: distclean rm -f *~ *\#*