summaryrefslogtreecommitdiff
path: root/GNUmakefile.in
blob: 7d688132fff784968e3e287678aeccd9b3aeef30 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# 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 <X11/...>, 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 *~ *\#*