Deleted Added
sdiff udiff text old ( 248753 ) new ( 251512 )
full compact
1# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
2# $FreeBSD: head/share/mk/bsd.prog.mk 248753 2013-03-26 20:32:46Z emaste $
3
4.include <bsd.init.mk>
5
6.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm
7
8# XXX The use of COPTS in modern makefiles is discouraged.
9.if defined(COPTS)
10CFLAGS+=${COPTS}

--- 8 unchanged lines hidden (view full) ---

19CFLAGS+=${DEBUG_FLAGS}
20CXXFLAGS+=${DEBUG_FLAGS}
21
22.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
23CTFFLAGS+= -g
24.endif
25.endif
26
27.if defined(CRUNCH_CFLAGS)
28CFLAGS+=${CRUNCH_CFLAGS}
29.endif
30
31.if !defined(DEBUG_FLAGS)
32STRIP?= -s
33.endif
34
35.if defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
36LDFLAGS+= -static
37.endif
38
39.if defined(PROG_CXX)
40PROG= ${PROG_CXX}
41.endif
42
43.if defined(PROG)
44PROGNAME?= ${PROG}
45.if defined(SRCS)
46
47OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
48
49.if target(beforelinking)
50beforelinking: ${OBJS}
51${PROG}: beforelinking
52.endif
53${PROG}: ${OBJS}
54.if defined(PROG_CXX)
55 ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
56.else
57 ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
58.endif
59.if ${MK_CTF} != "no"
60 ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
61.endif

--- 11 unchanged lines hidden (view full) ---

73# - it saves time rebuilding when only the library has changed
74# - the name of the object gets put into the executable symbol table instead of
75# the name of a variable temporary object.
76# - it's useful to keep objects around for crunching.
77OBJS+= ${PROG}.o
78
79.if target(beforelinking)
80beforelinking: ${OBJS}
81${PROG}: beforelinking
82.endif
83${PROG}: ${OBJS}
84.if defined(PROG_CXX)
85 ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
86.else
87 ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
88.endif
89.if ${MK_CTF} != "no"
90 ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
91.endif
92.endif
93
94.endif # !defined(SRCS)
95
96.if ${MK_MAN} != "no" && !defined(MAN) && \
97 !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
98 !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
99 !defined(MAN7) && !defined(MAN8) && !defined(MAN9)
100MAN= ${PROG}.1
101MAN1= ${MAN}
102.endif
103.endif # defined(PROG)
104
105all: objwarn ${PROG} ${SCRIPTS}
106.if ${MK_MAN} != "no"
107all: _manpages
108.endif
109
110.if defined(PROG)
111CLEANFILES+= ${PROG}
112.endif
113
114.if defined(OBJS)
115CLEANFILES+= ${OBJS}
116.endif
117
118.include <bsd.libnames.mk>
119
120.if defined(PROG)

--- 30 unchanged lines hidden (view full) ---

151
152.if !target(realinstall) && !defined(INTERNALPROG)
153realinstall: _proginstall
154.ORDER: beforeinstall _proginstall
155_proginstall:
156.if defined(PROG)
157 ${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
158 ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
159.endif
160.endif # !target(realinstall)
161
162.if defined(SCRIPTS) && !empty(SCRIPTS)
163realinstall: _scriptsinstall
164.ORDER: beforeinstall _scriptsinstall
165
166SCRIPTSDIR?= ${BINDIR}
167SCRIPTSOWN?= ${BINOWN}

--- 60 unchanged lines hidden ---