1993-08-15 23:37:04 +04:00
|
|
|
# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
|
1993-10-07 05:12:18 +03:00
|
|
|
# $Id: bsd.prog.mk,v 1.31 1993/10/07 02:12:18 cgd Exp $
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
1993-07-17 16:09:51 +04:00
|
|
|
.SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-08-15 23:37:04 +04:00
|
|
|
CFLAGS+= ${COPTS}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-03-27 15:17:32 +03:00
|
|
|
LIBCRT0?= /usr/lib/crt0.o
|
1993-03-21 12:45:37 +03:00
|
|
|
LIBC?= /usr/lib/libc.a
|
|
|
|
LIBCOMPAT?= /usr/lib/libcompat.a
|
1993-04-26 17:07:57 +04:00
|
|
|
LIBCRYPT?= /usr/lib/libcrypt.a
|
1993-03-21 12:45:37 +03:00
|
|
|
LIBCURSES?= /usr/lib/libcurses.a
|
|
|
|
LIBDBM?= /usr/lib/libdbm.a
|
|
|
|
LIBDES?= /usr/lib/libdes.a
|
|
|
|
LIBL?= /usr/lib/libl.a
|
|
|
|
LIBKDB?= /usr/lib/libkdb.a
|
|
|
|
LIBKRB?= /usr/lib/libkrb.a
|
|
|
|
LIBM?= /usr/lib/libm.a
|
|
|
|
LIBMP?= /usr/lib/libmp.a
|
|
|
|
LIBPC?= /usr/lib/libpc.a
|
|
|
|
LIBPLOT?= /usr/lib/libplot.a
|
|
|
|
LIBRESOLV?= /usr/lib/libresolv.a
|
1993-04-04 19:30:16 +04:00
|
|
|
LIBRPC?= /usr/lib/librpc.a
|
1993-06-04 18:47:21 +04:00
|
|
|
LIBRPCSVC?= /usr/lib/librpcsvc.a
|
1993-10-07 05:12:18 +03:00
|
|
|
LIBTERMCAP?= /usr/lib/libtermcap.a
|
1993-03-21 12:45:37 +03:00
|
|
|
LIBUTIL?= /usr/lib/libutil.a
|
|
|
|
|
|
|
|
.if defined(SHAREDSTRINGS)
|
|
|
|
CLEANFILES+=strings
|
|
|
|
.c.o:
|
|
|
|
${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
|
|
|
|
@${CC} ${CFLAGS} -c x.c -o ${.TARGET}
|
|
|
|
@rm -f x.c
|
1993-07-17 16:09:51 +04:00
|
|
|
|
|
|
|
.cc.o:
|
|
|
|
${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
|
|
|
|
@mv -f x.c x.cc
|
|
|
|
@${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
|
1993-08-16 00:42:39 +04:00
|
|
|
@rm -f x.cc
|
1993-07-17 16:09:51 +04:00
|
|
|
|
|
|
|
.C.o:
|
|
|
|
${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
|
|
|
|
@mv -f x.c x.C
|
|
|
|
@${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
|
1993-08-16 00:42:39 +04:00
|
|
|
@rm -f x.C
|
1993-03-21 12:45:37 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(PROG)
|
|
|
|
.if defined(SRCS)
|
|
|
|
|
1993-07-30 07:40:07 +04:00
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-03-27 15:17:32 +03:00
|
|
|
.if defined(LDONLY)
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
|
1993-03-27 15:17:32 +03:00
|
|
|
${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD}
|
|
|
|
|
|
|
|
.else defined(LDONLY)
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD}
|
1993-03-21 12:45:37 +03:00
|
|
|
${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
|
|
|
|
|
1993-03-27 15:17:32 +03:00
|
|
|
.endif
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
.else
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
SRCS= ${PROG}.c
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
${PROG}: ${SRCS} ${LIBC} ${DPADD}
|
1993-04-25 09:53:48 +04:00
|
|
|
${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
MKDEP= -p
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
|
|
|
|
!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
|
1993-04-25 08:15:26 +04:00
|
|
|
!defined(MAN7) && !defined(MAN8)
|
1993-03-21 12:45:37 +03:00
|
|
|
MAN1= ${PROG}.0
|
|
|
|
.endif
|
|
|
|
.endif
|
1993-04-25 08:55:52 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
.MAIN: all
|
1993-08-16 00:42:39 +04:00
|
|
|
all: ${PROG}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
.if !target(clean)
|
1993-08-16 00:42:39 +04:00
|
|
|
clean:
|
1993-03-21 12:45:37 +03:00
|
|
|
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
|
|
|
|
.endif
|
|
|
|
|
1993-08-16 00:59:36 +04:00
|
|
|
cleandir: clean
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
.if !target(install)
|
|
|
|
.if !target(beforeinstall)
|
|
|
|
beforeinstall:
|
1993-04-25 09:36:13 +04:00
|
|
|
.if defined(DESTDIR) || defined(BINDIR)
|
1993-08-15 23:26:05 +04:00
|
|
|
@install -d -o root -g wheel -m 755 ${DESTDIR}${BINDIR}
|
1993-03-21 12:45:37 +03:00
|
|
|
.endif
|
1993-04-25 09:36:13 +04:00
|
|
|
.endif
|
1993-03-21 12:45:37 +03:00
|
|
|
.if !target(afterinstall)
|
|
|
|
afterinstall:
|
|
|
|
.endif
|
|
|
|
|
1993-04-26 07:26:17 +04:00
|
|
|
.if !target(realinstall)
|
1993-08-16 00:42:39 +04:00
|
|
|
realinstall:
|
1993-03-21 12:45:37 +03:00
|
|
|
.if defined(PROG)
|
1993-04-10 00:05:56 +04:00
|
|
|
install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
1993-03-21 12:45:37 +03:00
|
|
|
${PROG} ${DESTDIR}${BINDIR}
|
|
|
|
.endif
|
|
|
|
.if defined(HIDEGAME)
|
|
|
|
(cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \
|
|
|
|
chown games.bin ${PROG})
|
|
|
|
.endif
|
1993-08-10 20:46:58 +04:00
|
|
|
.endif
|
|
|
|
|
1993-08-17 21:00:39 +04:00
|
|
|
install: maninstall _SUBDIRUSE
|
1993-03-21 12:45:37 +03:00
|
|
|
.if defined(LINKS) && !empty(LINKS)
|
|
|
|
@set ${LINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
l=${DESTDIR}$$1; \
|
|
|
|
shift; \
|
|
|
|
t=${DESTDIR}$$1; \
|
|
|
|
shift; \
|
|
|
|
echo $$t -\> $$l; \
|
|
|
|
rm -f $$t; \
|
|
|
|
ln $$l $$t; \
|
|
|
|
done; true
|
|
|
|
.endif
|
|
|
|
|
|
|
|
maninstall: afterinstall
|
|
|
|
afterinstall: realinstall
|
|
|
|
realinstall: beforeinstall
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(lint)
|
1993-08-16 00:42:39 +04:00
|
|
|
lint: ${SRCS}
|
1993-03-21 12:45:37 +03:00
|
|
|
.if defined(PROG)
|
|
|
|
@${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(NOMAN)
|
|
|
|
.include <bsd.man.mk>
|
|
|
|
.endif
|
1993-08-15 23:26:05 +04:00
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
1993-08-16 00:42:39 +04:00
|
|
|
.include <bsd.dep.mk>
|
1993-08-16 01:53:05 +04:00
|
|
|
.include <bsd.subdir.mk>
|