141369Sbostic.if exists(${.CURDIR}/../Makefile.inc) 241369Sbostic.include "${.CURDIR}/../Makefile.inc" 340510Sbostic.endif 439193Sbostic 5*41559Sbostic.SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 6*41559Sbostic 7*41559Sbostic.8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0: 8*41559Sbostic nroff -man -h ${.IMPSRC} > ${.TARGET} 9*41559Sbostic 10*41559SbosticCFLAGS+=${COPTS} 11*41559Sbostic 1241369SbosticLIBC?= /lib/libc.a 1341369SbosticLIBCOMPAT?= /usr/lib/libcompat.a 1441369SbosticLIBCURSES?= /usr/lib/libcurses.a 1541369SbosticLIBDBM?= /usr/lib/libdbm.a 1641369SbosticLIBDES?= /usr/lib/libdes.a 1741369SbosticLIBL?= /usr/lib/libl.a 1841369SbosticLIBKDB?= /usr/lib/libkdb.a 1941369SbosticLIBKRB?= /usr/lib/libkrb.a 2041369SbosticLIBM?= /usr/lib/libm.a 2141369SbosticLIBMP?= /usr/lib/libmp.a 2241369SbosticLIBPC?= /usr/lib/libpc.a 2341369SbosticLIBPLOT?= /usr/lib/libplot.a 2441369SbosticLIBRPC?= /usr/lib/sunrpc.a 2541369SbosticLIBTERM?= /usr/lib/libterm.a 2641369SbosticLIBUTIL?= /usr/lib/libutil.a 2739208Sbostic 28*41559Sbostic.if defined(SHAREDSTRINGS) 29*41559Sbostic.c.o: 30*41559Sbostic ${CC} -E ${CFLAGS} ${.IMPSRC} | /usr/bin/xstr -c - 31*41559Sbostic @${CC} ${CFLAGS} -c x.c -o ${.TARGET} 32*41559Sbostic @rm -f x.c 33*41559Sbostic.endif 34*41559Sbostic 3541556Sbostic.if defined(PROG) 3641369Sbostic.if defined(SRCS) 3739199Sbostic 3841369SbosticOBJS+= ${SRCS:.c=.o} 3939199Sbostic 4041369Sbostic${PROG}: ${OBJS} ${LIBC} ${DPADD} 4141369Sbostic ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} 4239208Sbostic 4341556Sbostic.else defined(PROG) 4439208Sbostic 4541369SbosticSRCS= ${PROG}.c 4639208Sbostic 4741369Sbostic${PROG}: ${SRCS} ${LIBC} ${DPADD} 4841369Sbostic ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} 4939193Sbostic 5041369Sbostic.endif 5139193Sbostic 5241369Sbostic.if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ 5341369Sbostic !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ 5441369Sbostic !defined(MAN7) && !defined(MAN8) && !defined(NOMAN) 5540510SbosticMAN1= ${PROG}.0 5639208Sbostic.endif 5741556Sbostic.endif 5841369SbosticMANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} 5939208Sbostic 6041369SbosticPROGSUBDIR: .USE 6141369Sbostic.if defined(SUBDIR) && !empty(SUBDIR) 6241369Sbostic @for entry in ${SUBDIR}; do \ 6341461Sbostic (echo "===> ${PROG}/$$entry"; \ 6441369Sbostic if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ 6541369Sbostic cd ${.CURDIR}/$${entry}.${MACHINE}; \ 6641369Sbostic else \ 6741369Sbostic cd ${.CURDIR}/$${entry}; \ 6841369Sbostic fi; \ 6941369Sbostic ${MAKE} ${.TARGET}) \ 7041369Sbostic done 7141369Sbostic.endif 7239193Sbostic 7341369Sbostic.MAIN: all 7441369Sbosticall: ${PROG} ${MANALL} PROGSUBDIR 7539193Sbostic 7641369Sbostic.if !target(clean) 7741369Sbosticclean: PROGSUBDIR 7841369Sbostic rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} 7939208Sbostic.endif 8039208Sbostic 8141461Sbostic.if !target(cleandir) 8241461Sbosticcleandir: PROGSUBDIR 8341369Sbostic rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} 8441369Sbostic rm -f .depend ${.CURDIR}/tags ${MANALL} 8541461Sbostic.endif 8639193Sbostic 8741369Sbostic# some of the rules involve .h sources, so remove them from mkdep line 8841461Sbostic.if !target(depend) 8941461Sbosticdepend: .depend 9041461Sbostic.depend: ${SRCS} PROGSUBDIR 9141369Sbostic mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c} 9241461Sbostic.endif 9339193Sbostic 9441461Sbostic.if !target(install) 9541461Sbostic.if !target(beforeinstall) 9641461Sbosticbeforeinstall: 9741461Sbostic.endif 9841461Sbostic 9941461Sbosticrealinstall: beforeinstall PROGSUBDIR 10039208Sbostic install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 10140510Sbostic ${PROG} ${DESTDIR}${BINDIR} 10241369Sbostic.if defined(HIDEGAME) 10341369Sbostic (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \ 10441369Sbostic chown games.bin ${PROG}) 10539208Sbostic.endif 10640510Sbostic 10741556Sbosticinstall: afterinstall PROGSUBDIR 10841556Sbosticafterinstall: realinstall maninstall 10941556Sbostic.else 11041556Sbosticinstall: PROGSUBDIR 11141461Sbostic.endif 11241461Sbostic 11341461Sbostic.if !target(lint) 11441461Sbosticlint: ${SRCS} PROGSUBDIR 11541369Sbostic @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1 11641461Sbostic.endif 11741369Sbostic 11841461Sbostic.if !target(tags) 11941461Sbostictags: ${SRCS} PROGSUBDIR 12041461Sbostic ctags -f ${.CURDIR}/tags ${.ALLSRC} 12141461Sbostic.endif 12241369Sbostic 12341369Sbostic.include <bsd.own.mk> 124