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