/
Makefile.in
347 lines (281 loc) · 10.7 KB
/
Makefile.in
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# $Id: Makefile.in,v 1.4 2002/11/05 12:44:36 ianedwards Exp $
# @(#)Makefile 1.23 05 Jun 1995 (UKC)
# -----------------------------------------------------------------------------
# Top level makefile for ups
# -----------------------------------------------------------------------------
SHELL = /bin/sh
@SET_MAKE@
srcdir = @srcdir@
topdir = @top_srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
# -----------------------------------------------------------------------------
# You may want to edit some of the following variables.
# Where to install the programs and manual page
#
prefix = @prefix@
exec_prefix = @exec_prefix@
BINDIR = ${DESTDIR}@bindir@
MANDIR = ${DESTDIR}@mandir@/man${MANSUFFIX}
INCDIR = ${DESTDIR}@includedir@
# The suffix to use for the manual page
#
MANSUFFIX = 1
# Specify mode/owner of installed files
#
MANPAGE_OWNER =
BINARY_OWNER =
HEADER_OWNER =
# The directory where X include files live.
#
X11_INC = @X_CFLAGS@
# The arguments to @CC@ needed to link against the Xlib library.
# Change this to an explicit path (e.g. /usr/X11/lib/libX11.a)
# if your Xlib lives in a place that won't be found by -lX11.
#
X11_LIB = @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@
# If you want you can pass make variable assignments to the
# subdirectory makefiles by uncommenting and editing the
# following assignment to EXTRA_SUBMAKEFLAGS.
#
# You can put multiple space separated assignments here if you want.
#
#EXTRA_SUBMAKEFLAGS = "-k"
# Flags for RISC/os from Conor Doherty and Hal R. Brand
# Edit HERE below to the absolute path to the ups source directory
#EXTRA_SUBMAKEFLAGS ="MORE_CFLAGS=-Driscos -DNO_DIRENT -DNO_PUTENV -IHERE/misc/riscos"
# If you are building ups for a Sun (any architecture) running SunOS 4.0.3
# or earlier then you must uncomment the following line. If you don't
# you will get incorrect values for char and short parameters. Note that
# this means you can't share a single ups binary between SunOS 4.1.1 and
# an earlier release. You need to turn this flag on for SunOS 3.X.
#
#EXTRA_SUBMAKEFLAGS = "ARCH_CFLAGS=-DFIX_SHORT_PARAMS"
# -----------------------------------------------------------------------------
CPPFLAGS = @CPPFLAGS@ @DEFS@ -I. ${X11_INC}
CFLAGS = @CFLAGS@ ${CPPFLAGS}
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RANLIB = @RANLIB@
LN_S = @LN_S@
UPS_TARGET = ups-native
UDB_TARGET = ups-gdb
DEF_TARGET = @DEF_TARGET@
SUBMAKEFLAGS = ${EXTRA_SUBMAKEFLAGS}
BINDIRS = ups med3 tests
LIBDIRS = lib/libx11wn lib/libmtrprog lib/libukcprog lib/libarg \
lib/libMen3 lib/libobj lib/libedit
COMMONLIBS = libx11wn libmtrprog libukcprog libarg \
libMen3 libobj libedit
SUBDIRS = ${LIBDIRS} ${BINDIRS}
# -----------------------------------------------------------------------------
# User targets
# -----------------------------------------------------------------------------
# Note: we use MFLAGS for the recursive makes rather than MAKEFLAGS.
# This is because the BSDI make loops forever if you say `make -',
# which is what you get if you say `${MAKE} -${MAKEFLAGS} when MAKEFLAGS
# is not set to anything.
default: ${DEF_TARGET}
all: ${DEF_TARGET} interpreter
ups: ups-native
interpreter: cx xc cg libci.a
install: install-${DEF_TARGET}
ups-native ups-gdb cx xc cg libci.a: ${COMMONLIBS}
cd ups && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} $@
med3: libx11wn libMen3
cd med3 && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} $@
${COMMONLIBS}: ups/develhdrs
cd lib/$@ && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS}
libgdb.a: ups/develhdrs
cd ups && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} $@
check:
@echo No automatic tests yet. 1>&2
tests: testprogs
testprogs:
cd tests && ${MAKE} ${MFLAGS} $@
install-ups-native: ups-native
cd ups && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} \
BINDIR=${BINDIR} \
INCDIR=${INCDIR} \
MANDIR=${MANDIR} MANSUFFIX=${MANSUFFIX} $@
install-med3: med3
cd med3 && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} \
BINDIR=${BINDIR} \
INCDIR=${INCDIR} \
MANDIR=${MANDIR} MANSUFFIX=${MANSUFFIX} $@
install-interpreter: cx xc cg libci.a
cd ups && ${MAKE} ${MFLAGS} ${SUBMAKEFLAGS} \
BINDIR=${BINDIR} \
MANDIR=${MANDIR} MANSUFFIX=${MANSUFFIX} $@
# Clean up so can rebuild with a 'make'
clean: rmlinks
for i in ${SUBDIRS}; do \
(cd $$i && ${MAKE} ${MFLAGS} clean); \
done
@${MAKE} ${MFLAGS} -f Makefile.conf clean
# Try to leave the source directory as it came in the distribution
# Does not do sub-directories but is "good enough"
distclean: clean
@-rm -f ifdefs.h config.log config.cache Makefile
@${MAKE} ${MFLAGS} -f Makefile.conf distclean
# -----------------------------------------------------------------------------
# Internal targets
# -----------------------------------------------------------------------------
rmlinks:
@-rm -f lib/libmtrprog/ifdefs.h
for i in ${SUBDIRS}; do \
rm -rf $$i/develhdrs; \
done
# The ups source assumes that various UKC libraries and header files
# are installed. We distribute ups so that the source is self contained:
# this target makes the symlinks needed to support this.
ups/develhdrs:
@echo "Making links to headers under ${topdir} ..."
@-for i in ${SUBDIRS}; do mkdir $$i/develhdrs; done
@-for i in Men3 arg mtrprog obj edit x11wn; do \
mkdir lib/lib$$i/develhdrs/local; \
done
@-for i in Men3 arg obj edit x11wn; do \
mkdir lib/lib$$i/develhdrs/mtrprog; \
done
@-for i in Men3 obj edit; do \
ln -s ../../../../${topdir}/lib/libx11wn/wn.h \
lib/lib$$i/develhdrs/local/wn.h; \
done
@-for i in arg mtrprog obj edit x11wn; do \
ln -s ../../../../${topdir}/lib/libukcprog/ukcprog.h \
lib/lib$$i/develhdrs/local/ukcprog.h; \
done
@-for i in obj; do \
ln -s ../../../../${topdir}/lib/libmtrprog/genmergesort.h \
lib/lib$$i/develhdrs/mtrprog/genmergesort.h; \
done
@-for i in obj; do \
ln -s ../../../../${topdir}/lib/libmtrprog/alloc.h \
lib/lib$$i/develhdrs/mtrprog/alloc.h; \
done
@-for i in edit; do \
ln -s ../../../../${topdir}/lib/libmtrprog/utils.h \
lib/lib$$i/develhdrs/mtrprog/utils.h; \
done
@-for i in ups med3; do \
mkdir $$i/develhdrs/local; \
mkdir $$i/develhdrs/mtrprog; \
done
@-ln -s ../../../../${topdir}/lib/libMen3/menu3.h lib/libx11wn/develhdrs/local/menu3.h
@-ln -s ../../../${topdir}/lib/libarg/arg.h ups/develhdrs/local/arg.h
@-ln -s ../../../${topdir}/lib/libMen3/menu3.h ups/develhdrs/local/menu3.h
@-ln -s ../../../${topdir}/lib/libobj ups/develhdrs/local/obj
@-ln -s ../../../${topdir}/lib/libedit ups/develhdrs/local/edit
@-ln -s ../../../${topdir}/lib/libukcprog/ukcprog.h ups/develhdrs/local/ukcprog.h
@-for f in alloc.h genmergesort.h hash.h io.h regex.h so.h strcache.h utils.h; do \
ln -s ../../../${topdir}/lib/libmtrprog/$$f \
ups/develhdrs/mtrprog/$$f; \
done
@-ln -s ../../../${topdir}/lib/libx11wn/wn.h ups/develhdrs/local/wn.h
@-ln -s ../../../${topdir}/lib/libMen3/menu3.h med3/develhdrs/local/menu3.h
@-ln -s ../../../${topdir}/lib/libx11wn/wn.h med3/develhdrs/local/wn.h
@echo "Making links to local ifdefs.h ..."
@-ln -s ../../ifdefs.h lib/libmtrprog/ifdefs.h
@-for i in Men3 arg obj edit x11wn; do \
ln -s ../../../../ifdefs.h \
lib/lib$$i/develhdrs/mtrprog/ifdefs.h; \
done
@-ln -s ../../../ifdefs.h ups/develhdrs/mtrprog/ifdefs.h
@-ln -s ../../../ifdefs.h med3/develhdrs/mtrprog/ifdefs.h
# -----------------------------------------------------------------------------
# Building a release
# -----------------------------------------------------------------------------
# The rest of this makefile is concerned only with making releases from
# the master source directory.
# Odd files needed for particular architectures etc.
MISCFILES = \
tkups \
misc/riscos/stdlib.h
# The gdb munging scripts and steering files
GDBFILES = gdbconf/initlist \
gdbconf/mkcalltree \
gdbconf/mkfunclist \
gdbconf/mkupsgdb \
gdbconf/mkccinfo \
gdbconf/mungeinit \
gdbconf/mungemakefile \
gdbconf/srcmunge \
gdbconf/zapcalls
# Files needed by AutoConf and configure
CONFIGFILES = \
Makefile.in Makefile.conf.in configure.in ifdefs.h.in \
configure config.guess config.sub install-sh upsconf.c
# Documentation, X application resources
DOCFILES = \
README README.gdb README.multiarch README.maintain FAQ INSTALL BUGS \
COPYING CHANGES Ups repltab PAD.xml README.dwarf
FILES = ${DOCFILES} ${GDBFILES} ${MISCFILES} ${CONFIGFILES}
FILELIST = releasefiles
CHECKRELEASE = checkrelease
RELROOT = releases
RELNAME = ups-`sccs prs -d:I: ups/sccsdata.c`${RELTAG}
# Make a release as a compressed tar file
release: ${CHECKRELEASE} filelist ${RELROOT}
@echo "Creating release file ${RELNAME} ..."
@-rm -f thesefiles
@sed -e "s;^;${RELNAME}/;" -e 's;/./;/;' < ${FILELIST} > thesefiles
@rm -f ${RELNAME}
@ln -s . ${RELNAME}
@tar cf - `cat thesefiles` | gzip > ${RELROOT}/${RELNAME}.tar.gz
@chmod 444 ${RELROOT}/${RELNAME}.tar.gz
@(cd ${RELROOT} && md5 ${RELNAME}.tar.gz > ${RELNAME}.md5)
@chmod 444 ${RELROOT}/${RELNAME}.md5
@rm -f ${RELNAME}
testrelease:
rm -f releases/ups-${RELTAG}.tar.gz
@rm -f releases/ups-${RELTAG}.md5
${MAKE} ${MFLAGS} CHECKRELEASE= RELNAME=ups-${RELTAG} release
${RELROOT}:
mkdir ${RELROOT}
# Check that everything is checked in OK for a release
checkrelease:
@echo "Checking release status ..."
@here=`pwd`; \
for i in ${SUBDIRS} .; do \
if cd $$i && make sccs_check; then \
echo $$i OK for release; \
else \
failed="$$failed $$i"; \
fi; \
cd $$here; \
done ; \
\
if test -n "$$failed"; then \
echo; \
echo Not ready for release: $$failed; \
exit 0; \
fi
sccs_check:
@sccsinfo ${FILES}
# Put into ${FILELIST} a list of all the files that make up an
# ups source release.
filelist:
@-rm -f ${FILELIST}
@: > ${FILELIST}
@for i in . lib ${SUBDIRS} ups-state interpreter packaging; do \
echo Adding files from $$i; \
(cd $$i && make list) | sed "s;^;$$i/;" >> ${FILELIST}; \
done
# Count ...
count:
@for i in ${SUBDIRS}; do \
(cd $$i && ${MAKE} ${MFLAGS} count | sed -n "s@total@$$i@p"); \
done
# List one to a line the files in this directory that should go in a release
list:
@echo ${FILES} | tr ' ' '\012'
# -----------------------------------------------------------------------------
# FreeBSD package/port, RPM etc.
# -----------------------------------------------------------------------------
freebsdport:
(cd packaging && ${MAKE} ${MFLAGS} freebsdport)
rpmspec:
(cd packaging && ${MAKE} ${MFLAGS} rpmspec)
# -----------------------------------------------------------------------------