-
Notifications
You must be signed in to change notification settings - Fork 3
/
Make.rules.in
259 lines (218 loc) · 6.54 KB
/
Make.rules.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
# Make.rules -*- Makefile -*-
#
# Common rules for building stuff. All of the Makefiles include this
# file.
#
# $Id$
# Note: there aren't many portable Makefile constructs. In particular,
# various versions of 'make' don't recognize one or more of
# VAR += VALUE
# VAR ?= DEFAULT_VALUE
# VAR != command
# so don't use these.
# The basics
PACKAGE = @PACKAGE@
VERSION = @VERSION@
# Various directories gleaned from `configure'
PREFIX = @prefix@
# Grrr... Freakin' capitalization!
prefix = ${PREFIX}
PERL_PREFIX = @PERL_PREFIX@
# GNU 'configure'-ism
exec_prefix = @exec_prefix@
BINDIR = @bindir@
SBINDIR = @sbindir@
LIBEXECDIR = @libexecdir@
CONDUITDIR = @CONDUITDIR@
DATADIR = @datadir@
LOCALEDIR = ${DATADIR}/locale
SYSCONFDIR = @sysconfdir@/coldsync
LIBDIR = @libdir@
INCLUDEDIR = @includedir@
INFODIR = @infodir@
MANDIR = @mandir@
MAN1DIR = ${MANDIR}/man1
MAN3DIR = ${MANDIR}/man3
MAN8DIR = ${MANDIR}/man8
# Subdirectory containing the Perl modules. Used by "configure --without-perl"
PERLDIR = @PERLDIR@
# Compilation-related programs and flags
CC = @CC@
CXX = @CXX@
DEFINES = @DEFS@
INCLUDES = ${INCLUDE} -I. -I${TOP} -I${TOP}/include
CXX_INCLUDEDIRS = \
-I/usr/include/c++ -I/usr/include/g++ \
-I${INCLUDEDIR}
CPPFLAGS = ${DEFINES} ${INCLUDES} @CPPFLAGS@
CFLAGS = @CFLAGS@ ${CPPFLAGS}
CXXFLAGS = @CXXFLAGS@ ${CPPFLAGS}
LEX = @LEX@
LEXARGS = @LEXARGS@
LIBLEX = @LEXLIB@
YACC = @YACC@
YACCARGS = @YACCARGS@ -d
LIBYACC = @LIBYACC@
LIBS = @LIBS@ ${EXTRA_LIBS}
LDFLAGS = @LDFLAGS@ ${LIBS}
LINT = @LINT@
LINTARGS = @LINTARGS@ ${CPPFLAGS}
RANLIB = @RANLIB@
# Other programs and utilities
PERL = @PERL@
# The name "POD2MAN_LOCAL" is because Perl uses "POD2MAN" for the actual
# rule that creates man pages from pods.
POD2MAN_LOCAL = @POD2MAN@
SED = @SED@
TAR = @TAR@
GZIP = @GZIP@
DATE = @DATE@
MKDEP = @MKDEP@
MAKEINFO = @MAKEINFO@
TEXI2DVI = @TEXI2DVI@
TEXI2HTML = @TEXI2HTML@
DVIPS = @DVIPS@
MKID = @MKID@
MKDIR = ${TOP}/mkinstalldirs
# I18n-related utilities
XGETTEXT = @XGETTEXT@
GETTEXT = @GETTEXT@
MSGMERGE = @MSGMERGE@
MSGFMT = @MSGFMT@
EXTRA_MSGFMT_ARGS = @EXTRA_MSGFMT_ARGS@
INSTALL_I18N = @INSTALL_I18N@
TOPDISTDIR = ${TOP}/${PACKAGE}-${VERSION}
DISTDIR = ${TOPDISTDIR}/${SUBDIR}
TARBALL = ${TOPDISTDIR}.tar.gz
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -m 555
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_MAN = ${INSTALL_DATA}
# End of 'configure'-generated stuff.
.SUFFIXES: .c .o .cc .ln
.SUFFIXES: .a
.SUFFIXES: .So .so
.c.o:
${CC} ${CFLAGS} -c $<
# XXX - Shared library object. This is only known to work under
# FreeBSD 4.2 for now.
.c.So:
${CC} -fpic -DPIC ${CFLAGS} -c $< -o $@
${LD} -o [email protected] -x -r $@
mv [email protected] $@
.cc.o:
${CXX} ${CXXFLAGS} -c $<
.c.ln:
${LINT} ${LINTARGS} -i $<
# Documentation-related rules
.SUFFIXES: .dvi .info .ps .texi .html
.texi.info:
${MAKEINFO} $<
.texi.dvi:
${TEXI2DVI} $<
.dvi.ps:
${DVIPS} -o $@ $<
# I18n-related rules
.SUFFIXES: .po .mo
.po.mo:
${MSGFMT} -v ${EXTRA_MSGFMT_ARGS} -o $@ $<
LIBRARY = lib${LIBNAME}.a
SHLIB = lib${LIBNAME}.so
SHLIBVER = lib${LIBNAME}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
# List of recursive targets, i.e., those where you build the target in
# each subdirectory.
RECURSIVE_TARGETS = \
all depend clean distclean spotless distfiles-core distfiles \
install lint TAGS
# This empty rule is so that `make' (build the first target) and `make
# all' will do the same thing. `all' is actually built according to
# the ${RECURSIVE_TARGETS} rule.
all::
# XXX - Should add "-R ${LIBDIR}" or "-rpath ${LIBDIR}" or "-Wl,-rpath
# ${LIBDIR}", whichever one the linker supports.
${PROG}: ${OBJS}
${CC} ${CFLAGS} ${OBJS} -o $@ ${LDFLAGS}
${CXXPROG}: ${OBJS}
${CXX} ${CXXFLAGS} ${OBJS} -o $@ ${LDFLAGS}
${LIBRARY}: ${LIBOBJS}
ar cr $@ ${LIBOBJS}
${RANLIB} $@
# XXX - Build a shared library from .So object files. This is only
# known to work under FreeBSD 4.2 for now.
${SHLIB} ${SHLIBVER}: ${SHLIBOBJS}
-rm -f ${SHLIBVER} ${SHLIB}
-ln -f -s ${SHLIBVER} ${SHLIB}
${CC} -shared -Wl,-x -o ${SHLIBVER} -Wl,-soname,${SHLIBVER} \
`lorder ${SHLIBOBJS} | tsort -q`
# lex.yy.o: lex.yy.c
# ${CC} ${CFLAGS} -c $<
lex.yy.c: lexer.l y.tab.h
${LEX} ${LEXARGS} lexer.l
# y.tab.o: y.tab.c
# ${CC} ${CFLAGS} -c $<
y.tab.c y.tab.h: parser.y
${YACC} ${YACCARGS} parser.y
# XXX - Ought to come up with a rule that'll do the Right Thing in all
# cases, whether you have C source, C++ source, or a mixture of both.
# depend::
# ${MKDEP} ${CPPFLAGS} ${C_SRCS} ${CXX_INCLUDEDIRS} ${CXX_SRCS}
# Targets for building the distribution.
# See the comment by ${RECURSIVE_TARGETS}::.
distfiles-core:: ${DISTFILES}
@subdirs="${SUBDIRS}"; \
for dir in "${subdirs}"; do \
if test ! -d "${TOPDISTDIR}/${SUBDIR}/$$dir"; then \
echo "mkdir ${TOPDISTDIR}/${SUBDIR}/$$dir"; \
${MKDIR} "${TOPDISTDIR}/${SUBDIR}/$$dir"; \
fi; \
done
@if test -n "${DISTFILES}"; then \
echo "cp -p ${DISTFILES} ${TOPDISTDIR}/${SUBDIR}"; \
cp -p ${DISTFILES} ${TOPDISTDIR}/${SUBDIR}; \
fi
distfiles:: distfiles-core ${EXTRA_DISTFILES}
@if test -n "${EXTRA_DISTFILES}"; then \
echo "cp -p ${EXTRA_DISTFILES} ${TOPDISTDIR}/${SUBDIR}"; \
cp -p ${EXTRA_DISTFILES} ${TOPDISTDIR}/${SUBDIR}; \
fi
TAGS::
files="${SRCS} ${HEADERS} ${OTHERTAGFILES}"; \
for f in $$files; do \
etags -a -o ${TOP}/TAGS $$f; \
done
# Common rule for building recursive targets
# The completely redundant subdirs="${SUBDIRS}" assignment is there
# because Sun's 'sh' can't parse
# for i in ; do echo $i; done
# It complains about a syntax error.
${RECURSIVE_TARGETS}::
@subdirs="${SUBDIRS}"; \
for dir in $$subdirs; do \
echo "$@: Entering directory \`${SUBDIR}/$$dir'"; \
(cd $$dir && \
${MAKE} SUBDIR="${SUBDIR}/$$dir" TOP=${TOP}/.. \
PREFIX="${PREFIX}" prefix="${prefix}" $@) || exit 1; \
echo "$@: Leaving directory \`${SUBDIR}/$$dir'"; \
done
# Targets for various progressive levels of cleanliness. Each one is
# cleaner than the previous. These need to go after the
# ${RECURSIVE_TARGETS} rule, because we want to clean up the lower
# directories before cleaning up the higher ones.
#
# clean: Delete all the files added by the compilation process
# (*.o, core, etc.)
# distclean: Delete anything that wasn't part of the distribution
# (clean + anything created by `configure')
# spotless: Delete anything that can't be recreated (distclean +
# `configure' itself, .ps files generated for the distribution
# as a courtesy, etc.)
clean-here:
-rm -f ${CLEAN}
clean:: clean-here
distclean-here:
-rm -f ${CLEAN} ${DISTCLEAN}
distclean:: distclean-here
spotless-here:
-rm -f ${CLEAN} ${DISTCLEAN} ${SPOTLESS}
spotless:: spotless-here