File: gmake.inc.in

package info (click to toggle)
dcc 1.2.74-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,552 kB
  • ctags: 4,041
  • sloc: ansic: 41,034; perl: 2,310; sh: 2,186; makefile: 224
file content (94 lines) | stat: -rw-r--r-- 2,246 bytes parent folder | download | duplicates (2)
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
# help make the Distributed Checksum Clearinghouse on Linux
#	without a common library of rules

# Copyright (c) 2005 by Rhyolite Software

# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.

# THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE
# BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

# Rhyolite Software DCC 1.2.74-1.31 $Revision$
# @configure_input@

ifdef SUBDIR
ifeq (,$(findstring k,$(MAKEFLAGS)))
SUBK	=set -e
endif
all install clean cleandir:
	@$(SUBK) $(foreach DIR,$(SUBDIR),echo "==> $(DIR)";	\
	    $(MAKE) --no-print-directory -C $(DIR) $@;)
endif

include ${DEPTH}/Makefile.inc

OBJS	=$(SRCS:.c=.o)

ifdef LIB
all:	lib$(LIB).a

lib$(LIB).a:$(OBJS)
	@rm -f lib${LIB}.a
	${AR} qcs lib${LIB}.a ${OBJS}
	@RANLIB@ lib$(LIB).a
endif


ifdef PROG
all:   $(PROG)

$(PROG):$(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) ${LDADD} -o $@

$(PROG):$(DPADD)
endif


clean cleandir:locclean
locclean:
	rm -f $(CLEANFILES) $(PROG)

install:beforeinstall locinstall
locinstall:maninstall proginstall

proginstall:beforeinstall
ifdef PROG
	$(BININSTALL) $(PROG) $(BINDIR)
endif

# gmake with gcc or IRIX compilers do not need the depend target
depend:
	@:

# Don't get excited about missing header files named in old .d files
#   Genuinely needed header files that have disappeared will break compiles.
%.h:
	@:

%.d:	%.c
	@$(CC) -M $(CFLAGS) $< \
	    | sed "s/^\([^ :]\{1,\}\)[ :]\{1,\}/\1 $@: /g" > $@

ifdef SRCS
ifneq ($(MAKECMDGOALS),cleandir)
ifneq ($(MAKECMDGOALS),clean)
@HAVE_CC_M@
ifndef HAVE_CC_M
ifeq ($(shell sh -c "$(CC) -v 2>&1 | sed -n -e 's/^gcc version .*/gcc/p'"),gcc)
HAVE_CC_M=yes
endif
endif
ifdef HAVE_CC_M
-include $(SRCS:.c=.d)
endif
endif
endif
endif