1#	$Id$
2#
3# HylaFAX Facsimile Software
4#
5# Copyright (c) 1988-1996 Sam Leffler
6# Copyright (c) 1991-1996 Silicon Graphics, Inc.
7# HylaFAX is a trademark of Silicon Graphics
8#
9# Permission to use, copy, modify, distribute, and sell this software and
10# its documentation for any purpose is hereby granted without fee, provided
11# that (i) the above copyright notices and this permission notice appear in
12# all copies of the software and related documentation, and (ii) the names of
13# Sam Leffler and Silicon Graphics may not be used in any advertising or
14# publicity relating to the software without the specific, prior written
15# permission of Sam Leffler and Silicon Graphics.
16#
17# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
18# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
19# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
20#
21# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
22# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
23# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
24# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
25# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
26# OF THIS SOFTWARE.
27
28#
29# Warning, this file was automatically created by the HylaFAX configure script
30#
31# VERSION:	@VERSION@
32# DATE:		@DATE@
33# TARGET:	@TARGET@
34# CCOMPILER:	@CCOMPILER@
35# CXXCOMPILER:	@CXXCOMPILER@
36#
37
38#
39# Common makefile rules.
40#
41# - After including defs, a makefile should say
42#   ``include ${COMMONRULES}'' to get this file.
43# - It is up to the including makefile to define a default rule before
44#   including ${COMMONRULES}.
45# - This file defines the following lists: SOURCES, enumerating all
46#   source files; OBJECTS, the .o files derived from compilable source;
47#   and DIRT, which lists intermediates and temporary files to be
48#   removed by clean.
49# - The including (parent) makefile may define source file lists for each
50#   standard suffix: CFILES for .c, etc.  This file combines all such
51#   lists into SOURCES.
52# - The parent makefile must define TARGETS in order for clobber to work.
53#
54SOURCES= ${HFILES} ${C++FILES} ${CFILES} ${SHFILES}
55OBJECTS= ${C++FILES:.c++=.o} ${CFILES:.c=.o}
56
57#
58# C++ inference rules.
59#
60.SUFFIXES: .c++ .yuk
61
62.c++:
63	${C++F} ${C++FILE} $<@MAKECXXOVERRIDE@ ${LDFLAGS} -o $@
64.c++.o:
65	${C++F} ${C++FILE} -c $<@MAKECXXOVERRIDE@
66.c++.s:
67	${C++F} ${C++FILE} -S $<@MAKECXXOVERRIDE@
68.c++.i:
69	${C++F} ${C++FILE} -E $<@MAKECXXOVERRIDE@ > $*.i
70.c++.yuk:
71	${C++F} ${C++FILE} -Fc -.yuk $<@MAKECXXOVERRIDE@
72
73#
74# Rather than removing ${OBJECTS}, clean removes ${CLEANOBJECTS} which we
75# set to *.[ou] by default, to remove obsolete objects and -O3 ucode files
76# after source has been reorganized.  If files ending in .[ou] should not
77# be removed by clean, this definition can be overridden after the include
78# of commonrules to define CLEANOBJECTS=${OBJECTS}.
79#
80CLEANOBJECTS= *.[ou]
81
82#
83# What gets cleaned, apart from objects.
84#
85DIRT= ${GDIRT} ${VDIRT} ${LDIRT}
86GDIRT= a.out core messages.po ${_FORCE}
87
88#
89# An always-unsatisfied target.
90#
91_FORCE= ${COMMONPREF}_force
92${_FORCE}:
93
94#
95# File removal rules: there are three.
96#	- clean removes intermediates and dirt
97#	- clobber removes targets as well as intermediates and dirt
98#	- rmtargets removes targets only
99# If you use incdepend (see below), then 'make clobber' will remove the
100# .*dependtime marker files used by incdepend to find modified ${DEPFILES}.
101#
102.PRECIOUS: .sdependtime .c++dependtime .cdependtime
103
104${COMMONPREF}clobber: ${COMMONPREF}clean ${COMMONPREF}rmtargets ${_FORCE}
105	-${RM} -rf Makefile ${MKDEPFILE} .*dependtime .*incdepend so_locations
106${COMMONPREF}distclean: ${COMMONPREF}clobber
107${COMMONPREF}clean: ${_FORCE}
108	-${RM} -rf ${CLEANOBJECTS} ${DIRT}
109${COMMONPREF}rmtargets: ${_FORCE}
110	-${RM} -rf ${TARGETS}
111
112#
113# Automated header dependency inference.  Most makefiles need only set the
114# CFILES, etc. lists and include commonrules.
115#
116${COMMONPREF}depend: ${_FORCE}
117	@Clist="${C++DEPFILES}" clist="${CDEPFILES}"; \
118	case "$$Clist" in \
119	  *.*) \
120	    ${ECHO} "${MKDEPENDC++} ${MKDEPFILE} $$Clist"; \
121	    ${MKDEPENDC++} ${MKDEPFILE} $$Clist; \
122	    touch .c++dependtime; \
123	esac; \
124	case "$$clist" in \
125	  *.*) \
126	    ${ECHO} "${MKDEPENDC} ${MKDEPFILE} $$clist"; \
127	    ${MKDEPENDC} ${MKDEPFILE} $$clist; \
128	    touch .cdependtime; \
129	esac
130_c++depend: ${C++DEPFILES} ${_FORCE}
131	${C++F} -M ${C++DEPFILES} | ${RAWDEPFILTER}; \
132	touch .c++incdepend
133_cdepend: ${CDEPFILES} ${_FORCE}
134	${CCF} -M ${CDEPFILES} | ${RAWDEPFILTER}; \
135	touch .cincdepend
136
137#
138# Incremental depend uses marker files to find ${DEPFILES} that are newer
139# than their dependencies.  Note that the non-incremental rules, above, also
140# touch the marker files.
141#
142# XXX can't run only one sub-make that depends on all .*dependtime, because
143# XXX smake will parallelize and mkdepend doesn't interlock itself
144#
145${COMMONPREF}incdepend: ${_FORCE}
146	@Clist="${C++DEPFILES}" clist="${CDEPFILES}"; \
147	case "$$Clist" in \
148	  *.*) \
149	    ${MAKE} -f ${MAKEFILE} _quiet.c++dependtime; \
150	esac; \
151	case "$$clist" in \
152	  *.*) \
153	    ${MAKE} -f ${MAKEFILE} _quiet.cdependtime; \
154	esac
155
156# so that make doesn't announce "`.sdependtime' is up to date."
157_quiet.c++dependtime: .c++dependtime
158_quiet.cdependtime: .cdependtime
159
160.c++dependtime: ${C++DEPFILES}
161	@if test -n "$?"; then \
162	    ${ECHO} "${MKDEPENDC++} -i ${MKDEPFILE} $?"; \
163	    ${MKDEPENDC++} -i ${MKDEPFILE} $?; \
164	    touch $@; \
165	fi
166.cdependtime: ${CDEPFILES}
167	@if test -n "$?"; then \
168	    ${ECHO} "${MKDEPENDC} -i ${MKDEPFILE} $?"; \
169	    ${MKDEPENDC} -i ${MKDEPFILE} $?; \
170	    touch $@; \
171	fi
172
173# you can't add dependencies to a target that begins with '.'
174_c++incdepend: .c++incdepend
175_cincdepend: .cincdepend
176
177.c++incdepend: ${C++DEPFILES}
178	@if test -n "$?"; then \
179	    ${C++F} -M $? | ${RAWDEPFILTER}; \
180	    touch $@; \
181	fi
182.cincdepend: ${CDEPFILES}
183	@if test -n "$?"; then \
184	    ${CCF} -M $? | ${RAWDEPFILTER}; \
185	    touch $@; \
186	fi
187
188#
189# A sed filter that prepends ${VPATH} to object targets emitted by cc -M.
190# ${VPATH} should name a directory that holds product-dependent objects.
191#
192RAWDEPFILTER= sed -e 's:^:${VPATH}/:'
193
194#include NLS stuff
195@MAKEINCLUDE@ @MAKELQUOTE@${DEPTH}/${TOPSRCDIR}/nls-rules.mk@MAKERQUOTE@
196
197#
198# Include the make dependency file if it exists.
199#
200@MAKEDEPINCLUDE@ @MAKELQUOTE@${MKDEPFILE}@MAKERQUOTE@
201