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