comparison gmake.inc.in @ 0:c7f6b056b673

First import of vendor version
author Peter Gervai <grin@grin.hu>
date Tue, 10 Mar 2009 13:49:58 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c7f6b056b673
1 # help make the Distributed Checksum Clearinghouse on Linux
2 # without a common library of rules
3
4 # Copyright (c) 2008 by Rhyolite Software, LLC
5 #
6 # This agreement is not applicable to any entity which sells anti-spam
7 # solutions to others or provides an anti-spam solution as part of a
8 # security solution sold to other entities, or to a private network
9 # which employs the DCC or uses data provided by operation of the DCC
10 # but does not provide corresponding data to other users.
11 #
12 # Permission to use, copy, modify, and distribute this software without
13 # changes for any purpose with or without fee is hereby granted, provided
14 # that the above copyright notice and this permission notice appear in all
15 # copies and any distributed versions or copies are either unchanged
16 # or not called anything similar to "DCC" or "Distributed Checksum
17 # Clearinghouse".
18 #
19 # Parties not eligible to receive a license under this agreement can
20 # obtain a commercial license to use DCC by contacting Rhyolite Software
21 # at sales@rhyolite.com.
22 #
23 # A commercial license would be for Distributed Checksum and Reputation
24 # Clearinghouse software. That software includes additional features. This
25 # free license for Distributed ChecksumClearinghouse Software does not in any
26 # way grant permision to use Distributed Checksum and Reputation Clearinghouse
27 # software
28 #
29 # THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE, LLC DISCLAIMS ALL
30 # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
31 # OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE, LLC
32 # BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
33 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
34 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
35 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
36 # SOFTWARE.
37
38 # Rhyolite Software DCC 1.3.103-1.42 $Revision$
39 # @configure_input@
40
41 GMAKE_QUIET=--no-print-directory
42
43 ifdef SUBDIR
44 ifeq (,$(findstring k,$(MAKEFLAGS)))
45 SUBK =set -e
46 endif
47 all install clean cleandir:
48 @$(SUBK) $(foreach DIR,$(SUBDIR),echo "==> $(DIR)"; \
49 $(MAKE) $(GMAKE_QUIET) -C $(DIR) $@;)
50 endif
51
52 include $(DEPTH)/Makefile.inc
53
54 OBJS =$(SRCS:.c=.o)
55
56 ifdef LIB
57 all: lib$(LIB).a
58
59 lib$(LIB).a:$(OBJS)
60 @rm -f lib${LIB}.a
61 ${AR} qcs lib${LIB}.a ${OBJS}
62 @RANLIB@ lib$(LIB).a
63
64 CLEANFILES+=lib$(LIB).a
65 endif
66
67
68 ifdef PROG
69 all: $(PROG)
70
71 $(PROG):$(OBJS)
72 $(CC) $(LDFLAGS) $(OBJS) ${LDADD} -o $@
73
74 $(PROG):$(DPADD)
75 endif
76
77 # do not let clean be the default target
78 all:
79
80 CLEANFILES+=$(OBJS) $(SRCS:.c=.d)
81 ifdef PROG
82 CLEANFILES+=$(PROG)
83 endif
84
85 clean cleandir:locclean
86 locclean:
87 ifeq "$(CLEANFILES)" " "
88 @:
89 else
90 rm -f $(CLEANFILES)
91 endif
92
93 install:beforeinstall locinstall
94 locinstall:maninstall proginstall
95
96 proginstall:beforeinstall
97 ifdef PROG
98 $(BININSTALL) $(PROG) $(BINDIR)
99 endif
100
101 # gmake with gcc or IRIX compilers do not need the depend target
102 depend:
103 @:
104
105 # Don't get excited about missing header files named in old .d files
106 # Genuinely needed header files that have disappeared will break compiles.
107 %.h:
108 @:
109
110 %.d: %.c
111 @$(CC) -M $(CFLAGS) $< \
112 | sed "s!^\([^ :]\{1,\}\)[ :]\{1,\}!\1 $@: !g" > $@
113
114 # include the .d file if we have any C source and we are not deleting things
115 @HAVE_CC_M@
116 ifndef SRCS
117 HAVE_CC_M=no
118 endif
119 ifeq ($(MAKECMDGOALS),cleandir)
120 HAVE_CC_M=no
121 endif
122 ifeq ($(MAKECMDGOALS),clean)
123 HAVE_CC_M=no
124 endif
125 ifeq ($(MAKECMDGOALS),deinstall)
126 HAVE_CC_M=no
127 endif
128 ifndef HAVE_CC_M
129 ifeq ($(shell sh -c "$(CC) -v 2>&1 | sed -n -e 's/^gcc version .*/gcc/p'"),gcc)
130 HAVE_CC_M=yes
131 endif
132 endif
133 ifeq ($(HAVE_CC_M),yes)
134 -include $(SRCS:.c=.d)
135 endif
136
137 # Try to rebuild the .0 man pages from the shipped .8 files on systems
138 # with gmake and groff so that they will have local directory names
139 @USE_GROFF@
140 ifeq ($(USE_GROFF),yes)
141 .SUFFIXES:.0 .8 .html
142 .8.0::
143 groff -Tascii -mtty-char -mdoc $*.8 > $@
144 endif