Annotation of src/share/mk/bsd.prog.mk, Revision 1.47
1.47 ! cgd 1: # $NetBSD: bsd.prog.mk,v 1.46 1994/07/06 04:13:37 mycroft Exp $
1.44 cgd 2: # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
1.1 cgd 3:
4: .if exists(${.CURDIR}/../Makefile.inc)
5: .include "${.CURDIR}/../Makefile.inc"
6: .endif
7:
1.18 mycroft 8: .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
1.1 cgd 9:
1.25 mycroft 10: CFLAGS+= ${COPTS}
1.1 cgd 11:
1.46 mycroft 12: LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
13: LIBC?= ${DESTDIR}/usr/lib/libc.a
14: LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
15: LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
16: LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
17: LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
18: LIBDES?= ${DESTDIR}/usr/lib/libdes.a
19: LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
20: LIBL?= ${DESTDIR}/usr/lib/libl.a
21: LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
22: LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
23: LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
24: LIBM?= ${DESTDIR}/usr/lib/libm.a
25: LIBMP?= ${DESTDIR}/usr/lib/libmp.a
26: LIBPC?= ${DESTDIR}/usr/lib/libpc.a
27: LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a
28: LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
29: LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
30: LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
31: LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
32: LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
1.1 cgd 33:
34: .if defined(SHAREDSTRINGS)
35: CLEANFILES+=strings
36: .c.o:
37: ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
38: @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
39: @rm -f x.c
1.18 mycroft 40:
41: .cc.o:
42: ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
43: @mv -f x.c x.cc
44: @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.26 mycroft 45: @rm -f x.cc
1.18 mycroft 46:
47: .C.o:
48: ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
49: @mv -f x.c x.C
50: @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
1.26 mycroft 51: @rm -f x.C
1.1 cgd 52: .endif
53:
1.38 jtc 54:
1.1 cgd 55: .if defined(PROG)
1.40 cgd 56: SRCS?= ${PROG}.c
1.45 cgd 57: .if !empty(SRCS:N*.h:N*.sh)
1.42 jtc 58: OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.45 cgd 59: .endif
1.1 cgd 60:
1.47 ! cgd 61: .if defined(OBJS) && !empty(OBJS)
1.46 mycroft 62: .if defined(DESTDIR)
1.4 nate 63:
1.26 mycroft 64: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.46 mycroft 65: ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
1.4 nate 66:
1.46 mycroft 67: .else
1.4 nate 68:
1.26 mycroft 69: ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
1.32 cgd 70: ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
1.1 cgd 71:
1.47 ! cgd 72: .endif # defined(DESTDIR)
! 73: .endif # defined(OBJS) && !empty(OBJS)
1.1 cgd 74:
75: .if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
76: !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
1.10 mycroft 77: !defined(MAN7) && !defined(MAN8)
1.1 cgd 78: MAN1= ${PROG}.0
79: .endif
80: .endif
1.11 mycroft 81:
1.1 cgd 82: .MAIN: all
1.43 cgd 83: all: ${PROG} _SUBDIRUSE
1.1 cgd 84:
85: .if !target(clean)
1.43 cgd 86: clean: _SUBDIRUSE
1.36 mycroft 87: rm -f a.out [Ee]rrs mklog core *.core ${PROG} ${OBJS} ${CLEANFILES}
1.1 cgd 88: .endif
89:
1.43 cgd 90: cleandir: _SUBDIRUSE clean
1.27 mycroft 91:
1.1 cgd 92: .if !target(install)
93: .if !target(beforeinstall)
94: beforeinstall:
95: .endif
96: .if !target(afterinstall)
97: afterinstall:
98: .endif
99:
1.14 mycroft 100: .if !target(realinstall)
1.26 mycroft 101: realinstall:
1.1 cgd 102: .if defined(PROG)
1.9 cgd 103: install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1.1 cgd 104: ${PROG} ${DESTDIR}${BINDIR}
105: .endif
106: .if defined(HIDEGAME)
1.41 cgd 107: (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG})
1.1 cgd 108: .endif
1.23 mycroft 109: .endif
110:
1.29 mycroft 111: install: maninstall _SUBDIRUSE
1.1 cgd 112: .if defined(LINKS) && !empty(LINKS)
113: @set ${LINKS}; \
114: while test $$# -ge 2; do \
115: l=${DESTDIR}$$1; \
116: shift; \
117: t=${DESTDIR}$$1; \
118: shift; \
119: echo $$t -\> $$l; \
120: rm -f $$t; \
121: ln $$l $$t; \
122: done; true
1.14 mycroft 123: .endif
1.1 cgd 124:
125: maninstall: afterinstall
126: afterinstall: realinstall
127: realinstall: beforeinstall
128: .endif
129:
130: .if !target(lint)
1.43 cgd 131: lint: ${SRCS} _SUBDIRUSE
1.1 cgd 132: .if defined(PROG)
133: @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
134: .endif
135: .endif
136:
137: .if !defined(NOMAN)
138: .include <bsd.man.mk>
139: .endif
1.24 mycroft 140:
141: .include <bsd.obj.mk>
1.26 mycroft 142: .include <bsd.dep.mk>
1.28 mycroft 143: .include <bsd.subdir.mk>
CVSweb <webmaster@jp.NetBSD.org>