version 1.26, 1993/08/15 20:42:43 |
version 1.52, 1995/06/24 08:28:08 |
|
|
# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 |
# $NetBSD$ |
# $Id$ |
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 |
|
|
.if exists(${.CURDIR}/../Makefile.inc) |
.if exists(${.CURDIR}/../Makefile.inc) |
.include "${.CURDIR}/../Makefile.inc" |
.include "${.CURDIR}/../Makefile.inc" |
.endif |
.endif |
|
|
|
.include <bsd.own.mk> |
|
|
.SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 |
.SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 |
|
|
CFLAGS+= ${COPTS} |
CFLAGS+= ${COPTS} |
|
|
LIBCRT0?= /usr/lib/crt0.o |
LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o |
LIBC?= /usr/lib/libc.a |
LIBC?= ${DESTDIR}/usr/lib/libc.a |
LIBCOMPAT?= /usr/lib/libcompat.a |
LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a |
.ifndef EXPORTABLE_SYSTEM |
LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a |
LIBCRYPT?= /usr/lib/libcrypt.a |
LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a |
.endif |
LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a |
LIBCURSES?= /usr/lib/libcurses.a |
LIBDES?= ${DESTDIR}/usr/lib/libdes.a |
LIBDBM?= /usr/lib/libdbm.a |
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a |
LIBDES?= /usr/lib/libdes.a |
LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a |
LIBL?= /usr/lib/libl.a |
LIBL?= ${DESTDIR}/usr/lib/libl.a |
LIBKDB?= /usr/lib/libkdb.a |
LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a |
LIBKRB?= /usr/lib/libkrb.a |
LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a |
LIBM?= /usr/lib/libm.a |
LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a |
LIBMP?= /usr/lib/libmp.a |
LIBM?= ${DESTDIR}/usr/lib/libm.a |
LIBPC?= /usr/lib/libpc.a |
LIBMP?= ${DESTDIR}/usr/lib/libmp.a |
LIBPLOT?= /usr/lib/libplot.a |
LIBPC?= ${DESTDIR}/usr/lib/libpc.a |
LIBRESOLV?= /usr/lib/libresolv.a |
LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a |
LIBRPC?= /usr/lib/librpc.a |
LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a |
LIBRPCSVC?= /usr/lib/librpcsvc.a |
LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a |
LIBTERM?= /usr/lib/libterm.a |
LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a |
LIBUTIL?= /usr/lib/libutil.a |
LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a |
|
LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a |
|
|
.if defined(SHAREDSTRINGS) |
.if defined(SHAREDSTRINGS) |
CLEANFILES+=strings |
CLEANFILES+=strings |
Line 51 CLEANFILES+=strings |
|
Line 54 CLEANFILES+=strings |
|
@rm -f x.C |
@rm -f x.C |
.endif |
.endif |
|
|
.if defined(PROG) |
|
.if defined(SRCS) |
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.o/g} |
|
|
|
.if defined(LDONLY) |
.if defined(PROG) |
|
SRCS?= ${PROG}.c |
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} |
.if !empty(SRCS:N*.h:N*.sh) |
${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD} |
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} |
|
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} |
|
.endif |
|
|
.else defined(LDONLY) |
.if defined(OBJS) && !empty(OBJS) |
|
.if defined(DESTDIR) |
|
|
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} |
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} |
${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} |
${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc |
|
|
.endif |
|
|
|
.else |
.else |
|
|
SRCS= ${PROG}.c |
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} |
|
${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} |
${PROG}: ${SRCS} ${LIBC} ${DPADD} |
|
${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} |
|
|
|
MKDEP= -p |
|
|
|
.endif |
.endif # defined(DESTDIR) |
|
.endif # defined(OBJS) && !empty(OBJS) |
|
|
.if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ |
.if !defined(MAN) |
!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ |
MAN= ${PROG}.1 |
!defined(MAN7) && !defined(MAN8) |
.endif # !defined(MAN) |
MAN1= ${PROG}.0 |
.endif # defined(PROG) |
.endif |
|
.endif |
|
|
|
.MAIN: all |
.MAIN: all |
all: ${PROG} |
all: ${PROG} _SUBDIRUSE |
|
|
.if !target(clean) |
.if !target(clean) |
clean: |
clean: _SUBDIRUSE |
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} |
rm -f a.out [Ee]rrs mklog core *.core |
|
rm -f ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES} |
.endif |
.endif |
|
|
|
cleandir: _SUBDIRUSE clean |
|
|
.if !target(install) |
.if !target(install) |
.if !target(beforeinstall) |
.if !target(beforeinstall) |
beforeinstall: |
beforeinstall: |
.if defined(DESTDIR) || defined(BINDIR) |
|
@install -d -o root -g wheel -m 755 ${DESTDIR}${BINDIR} |
|
.endif |
|
.endif |
.endif |
.if !target(afterinstall) |
.if !target(afterinstall) |
afterinstall: |
afterinstall: |
|
|
${PROG} ${DESTDIR}${BINDIR} |
${PROG} ${DESTDIR}${BINDIR} |
.endif |
.endif |
.if defined(HIDEGAME) |
.if defined(HIDEGAME) |
(cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \ |
(cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}) |
chown games.bin ${PROG}) |
|
.endif |
.endif |
.endif |
.endif |
|
|
install: maninstall |
install: maninstall _SUBDIRUSE |
.if defined(LINKS) && !empty(LINKS) |
.if defined(LINKS) && !empty(LINKS) |
@set ${LINKS}; \ |
@set ${LINKS}; \ |
while test $$# -ge 2; do \ |
while test $$# -ge 2; do \ |
Line 137 realinstall: beforeinstall |
|
Line 131 realinstall: beforeinstall |
|
.endif |
.endif |
|
|
.if !target(lint) |
.if !target(lint) |
lint: ${SRCS} |
lint: ${LOBJS} |
.if defined(PROG) |
.if defined(LOBJS) && !empty(LOBJS) |
@${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1 |
@${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD} |
.endif |
.endif |
.endif |
.endif |
|
|
cleandir: clean |
|
|
|
.if !defined(NOMAN) |
.if !defined(NOMAN) |
.include <bsd.man.mk> |
.include <bsd.man.mk> |
.endif |
.endif |
|
|
|
.if !defined(NONLS) |
|
.include <bsd.nls.mk> |
|
.endif |
|
|
.include <bsd.obj.mk> |
.include <bsd.obj.mk> |
.include <bsd.dep.mk> |
.include <bsd.dep.mk> |
.include <bsd.subdir.mk> |
.include <bsd.subdir.mk> |