home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bsd
/
src
/
make
/
make-amiga
/
share
/
bsd.prog.mk
< prev
next >
Wrap
Makefile
|
1994-02-25
|
4KB
|
178 lines
# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
.SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
.8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:
sh nroff -mandoc ${.IMPSRC} > ${.TARGET}
CFLAGS+=${COPTS}
STRIP?= -s
BINGRP?= bin
BINOWN?= bin
BINMODE?= 555
LIBC?= /bsd/lib/libc.a
LIBCOMPAT?= /bsd/lib/libcompat.a
LIBCURSES?= /bsd/lib/libcurses.a
LIBDBM?= /bsd/lib/libdbm.a
LIBDES?= /bsd/lib/libdes.a
LIBL?= /bsd/lib/libl.a
LIBKDB?= /bsd/lib/libkdb.a
LIBKRB?= /bsd/lib/libkrb.a
LIBM?= /bsd/lib/libm.a
LIBMP?= /bsd/lib/libmp.a
LIBPC?= /bsd/lib/libpc.a
LIBPLOT?= /bsd/lib/libplot.a
LIBRESOLV?= /bsd/lib/libresolv.a
LIBRPC?= /bsd/lib/sunrpc.a
LIBTERM?= /bsd/lib/libterm.a
LIBUTIL?= /bsd/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
.endif
.if defined(PROG)
.if defined(SRCS)
OBJS+= ${SRCS:R:S/$/.o/g}
${PROG}: ${OBJS} ${LIBC} ${DPADD}
${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.else defined(PROG)
SRCS= ${PROG}.c
${PROG}: ${SRCS} ${LIBC} ${DPADD}
${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}
MKDEP= -p
.endif
.if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
!defined(MAN7) && !defined(MAN8) && !defined(NOMAN)
MAN1= ${PROG}.0
.endif
.endif
MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
_PROGSUBDIR: .USE
.if defined(SUBDIR) && !empty(SUBDIR)
@for entry in ${SUBDIR}; do \
(echo "===> $$entry"; \
if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
cd ${.CURDIR}/$${entry}.${MACHINE}; \
else \
cd ${.CURDIR}/$${entry}; \
fi; \
${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
done
.endif
.MAIN: all
all: ${PROG} ${MANALL} _PROGSUBDIR
.if !target(clean)
clean: _PROGSUBDIR
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
.endif
.if !target(cleandir)
cleandir: _PROGSUBDIR
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
rm -f .depend ${MANALL}
.endif
# some of the rules involve .h sources, so remove them from mkdep line
.if !target(depend)
depend: .depend _PROGSUBDIR
.depend: ${SRCS}
.if defined(PROG)
mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
.endif
.endif
.if !target(install)
.if !target(beforeinstall)
beforeinstall:
.endif
.if !target(afterinstall)
afterinstall:
.endif
realinstall: _PROGSUBDIR
.if defined(PROG)
install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${PROG} ${DESTDIR}${BINDIR}
.endif
.if defined(HIDEGAME)
(cd ${DESTDIR}/bsd/games; rm -f ${PROG}; ln -s dm ${PROG}; \
chown games.bin ${PROG})
.endif
.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
install: maninstall
maninstall: afterinstall
afterinstall: realinstall
realinstall: beforeinstall
.endif
.if !target(lint)
lint: ${SRCS} _PROGSUBDIR
.if defined(PROG)
@${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
.endif
.endif
.if !target(obj)
.if defined(NOOBJ)
obj: _PROGSUBDIR
.else
obj: _PROGSUBDIR
@cd ${.CURDIR}; rm -rf obj; \
here=`pwd`; dest=/bsd/obj/`echo $$here | sed 's,/bsd/src/,,'`; \
echo "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /bsd/obj -a ! -d $$dest; then \
mkdir -p $$dest; \
else \
true; \
fi;
.endif
.endif
.if !target(tags)
tags: ${SRCS} _PROGSUBDIR
.if defined(PROG)
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \
sed "s;\${.CURDIR}/;;" > tags
.endif
.endif
.if !defined(NOMAN)
.include <bsd.man.mk>
.endif