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