# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
.if exists
(${.CURDIR
}/..
/Makefile.inc
)
.
include "${.CURDIR}/../Makefile.inc"
.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:
nroff
-mandoc
${.IMPSRC
} > ${.TARGET
}
LIBCOMPAT?
= /usr
/lib
/libcompat.a
LIBCURSES?
= /usr
/lib
/libcurses.a
LIBDBM?
= /usr
/lib
/libdbm.a
LIBDES?
= /usr
/lib
/libdes.a
LIBKDB?
= /usr
/lib
/libkdb.a
LIBKRB?
= /usr
/lib
/libkrb.a
LIBPLOT?
= /usr
/lib
/libplot.a
LIBRESOLV?
= /usr
/lib
/libresolv.a
LIBRPC?
= /usr
/lib
/sunrpc.a
LIBTERM?
= /usr
/lib
/libterm.a
LIBUTIL?
= /usr
/lib
/libutil.a
.if defined
(SHAREDSTRINGS
)
${CC} -E
${CFLAGS} ${.IMPSRC
} | xstr
-c
-
@
${CC} ${CFLAGS} -c x.c
-o
${.TARGET
}
OBJS
+= ${SRCS
:R
:S
/$/.o
/g
}
${PROG}: ${OBJS} ${LIBC} ${DPADD}
${CC} ${LDFLAGS} -o
${.TARGET
} ${OBJS} ${LDADD}
${PROG}: ${SRCS} ${LIBC} ${DPADD}
${CC} ${CFLAGS} -o
${.TARGET
} ${.CURDIR
}/${SRCS} ${LDADD}
.if
!defined
(MAN1
) && !defined
(MAN2
) && !defined
(MAN3
) && \
!defined
(MAN4
) && !defined
(MAN5
) && !defined
(MAN6
) && \
!defined
(MAN7
) && !defined
(MAN8
) && !defined
(NOMAN
)
MANALL
= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
.if defined
(SUBDIR
) && !empty
(SUBDIR
)
@for entry in
${SUBDIR}; do \
if
test -d
${.CURDIR
}/$${entry}.
${MACHINE}; then \
cd
${.CURDIR
}/$${entry}.
${MACHINE}; \
cd
${.CURDIR
}/$${entry}; \
${MAKE} ${.TARGET
:S
/realinstall
/install/:S
/.depend
/depend
/}); \
all: ${PROG} ${MANALL} _PROGSUBDIR
rm -f a.out
[Ee
]rrs mklog core
${PROG} ${OBJS} ${CLEANFILES}
rm -f a.out
[Ee
]rrs mklog core
${PROG} ${OBJS} ${CLEANFILES}
# some of the rules involve .h sources, so remove them from mkdep line
depend
: .depend _PROGSUBDIR
mkdep
${MKDEP} ${CFLAGS
:M-
[ID
]*} ${.ALLSRC
:M
*.c
}
.if
!target
(beforeinstall
)
.if
!target
(afterinstall
)
install ${STRIP} -o
${BINOWN} -g
${BINGRP} -m
${BINMODE} \
${PROG} ${DESTDIR}${BINDIR}
(cd
${DESTDIR}/usr
/games
; rm -f
${PROG}; ln
-s dm
${PROG}; \
.if defined
(LINKS
) && !empty
(LINKS
)
while
test $$# -ge 2; do \
afterinstall
: realinstall
realinstall
: beforeinstall
lint
: ${SRCS} _PROGSUBDIR
@
${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC
} | more
2>&1
@cd
${.CURDIR
}; rm -rf obj
; \
here
=`pwd`; dest
=/usr
/obj
/`echo $$here | sed 's,/usr/src/,,'`; \
echo
"$$here -> $$dest"; ln
-s
$$dest obj
; \
if
test -d
/usr
/obj
-a
! -d
$$dest; then \
tags: ${SRCS} _PROGSUBDIR
-cd
${.CURDIR
}; ctags
-f
/dev
/stdout
${.ALLSRC
} | \
sed
"s;\${.CURDIR}/;;" > tags