rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / usr / include / make / commonrules
CommitLineData
7faf1d71
AW
1# Copyright (c) 1991-2000 Silicon Graphics, Inc.
2# This document is licensed under the SGI Free Software B license.
3# For details, see
4#
5# http://oss.sgi.com/projects/FreeB
6#
7# $Date$ $Revision$
8# $Header: //depot/main/tools/include/commonrules#21 $
9
10#
11# Notes:
12# - After including $(ROOT)/usr/include/make/commondefs, a makefile may
13# say ``include $(COMMONRULES)'' to get this file.
14# - It is up to the including makefile to define a default rule before
15# including $(COMMONRULES).
16# - The parent makefile must define TARGETS in order for clobber to work.
17# - If the parent makefile must overload the common targets with special
18# rules (e.g. to perform recursive or subdirectory makes), then set
19# COMMONPREF to some unique prefix before including $(COMMONRULES),
20# and make sure that each common target depends on its prefixed name.
21# For example, a makefile which passes common targets and install on
22# to makes in subdirectories listed in DIRS might say
23#
24# COMMONPREF=xxx
25# include $(COMMONRULES)
26#
27# $(COMMONTARGS) install: $(COMMONPREF)$$@
28# @for d in $(DIRS); do \
29# $(ECHO) "\tcd $$d; $(MAKE) $@"; \
30# cd $$d; $(MAKE) $@; cd ..; \
31# done
32#
33# Thus, all of the common rules plus install are passed to sub-makes
34# *and* executed in the current makefile (as xxxclean, xxxclobber,
35# xxxinstall, etc). SUBDIRS_MAKERULE in commondefs is a convenience
36# macro that expands to the above loop.
37#
38
39
40#
41# cleaning targets
42#
43$(COMMONPREF)clobber: $(COMMONPREF)clean $(COMMONPREF)rmtargets
44ifdef MKDEPFILE
45 $(RM) -r $(MKDEPFILE)
46endif
47
48$(COMMONPREF)clean:
49ifdef DIRT
50 $(RM) -r $(DIRT)
51endif
52
53$(COMMONPREF)rmtargets:
54ifdef TARGETS
55 $(RM) -r $(TARGETS)
56endif
57
58#
59# targets to build distributions
60#
61-include $(DISTFILE)
62
63# build SI distribution
64$(COMMONPREF)distsi:
65 @$(INSTALL) $(INSTALLFLAGS) -F $(DIST)/$(DISTDIR_SI) $(DISTFILES_SI)
66 @$(ECHO) ""
67
68# build OSS distribution
69$(COMMONPREF)distoss:
70 @$(INSTALL) $(INSTALLFLAGS_OSS) -F $(DIST)/$(DISTDIR_OSS) $(DISTFILES_OSS)
71 @$(ECHO) ""
72
73#
74# additional target for .cxx files. (gmake only likes .C and .cc)
75#
76%.o : %.cxx
77 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
78
79#
80# preprocessor only target
81#
82%.i : %.c
83 $(CC) -E $(CPPFLAGS) $(CFLAGS) $< | $(SED) -e 's/^ $$//' | $(UNIQ) > $@
84
85%.i : %.cc %.C %.cxx
86 $(CXX) -E $(CPPFLAGS) $(CXXFLAGS) $< | $(SED) -e 's/^ $$//' | $(UNIQ) > $@
87
88#
89# include the make dependency file(s), if they exist
90#
91-include $(MKDEPFILE)
92
93#
94# Local make rules
95#
96-include $(LOCALRULES)