# libraries used for dependency lines
LIBUTIL
= /usr
/lib
/libutil.a
LIBKRB
= /usr
/lib
/libkrb.a
LIBDES
= /usr
/lib
/libdes.a
LIBCOMPAT
= /usr
/lib
/libcompat.a
# any specified manual pages -- if none have been specified at this point,
# we make assumptions about what they are and what they're called.
MANALL
= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
# SUBDIR -- the list of subdirectories to be processed
# if SUBDIR is set, we're in a makefile that processes subdirectories;
# for all the standard targets, change to the subdirectory and make the
# target. If making one of the subdirectories, change to it and make
# the target "all". Machine dependent subdirectories take precedence
# over standard subdirectories.
all depend
clean cleandir lint
install tags:
@for entry in
${SUBDIR}; do
if
test -d
$${entry}.
${MACHINE}; then
@if
test -d
${.TARGET
}.
${MACHINE}; then
# SHAREDSTRINGS -- boolean variable, if sharing strings in objects.
# if SHAREDSTRINGS is defined, use XSTR to build objects.
.if defined
(SHAREDSTRINGS
)
${CC} -E
${.INCLUDES
} ${CFLAGS} ${.IMPSRC
} |
${XSTR} -c
-
@
${CC} ${.INCLUDES
} ${CFLAGS} -c x.c
-o
${.TARGET
}
# the default target is all
# PROGC -- the name of a program composed of a single source module
# PROGO -- the name of a program composed of several object modules
# SRCLIB -- the list of libraries that the program depends on;
# normally from the LIB* list at the top of this file.
# LDLIB -- the list of libraries that the program loads, in the
# format expected by the loader.
# if the program is composed of a single source module, that module is
# C source with the same name as the program. If no manual pages have
# been defined, it's in section 1 with the same name as the program.
.if
!defined
(MAN1
) && !defined
(MAN2
) && !defined
(MAN3
) && !defined
(MAN4
) && !defined
(MAN5
) && !defined
(MAN6
) && !defined
(MAN7
) && !defined
(MAN8
)
${PROGC}: ${SRCS} ${LIBC} ${SRCLIB}
${CC} ${CFLAGS} -o
${.TARGET
} ${SRCS} ${LDLIB}
${CPP} -M
${CFLAGS
:M-
[ID
]*} ${.INCLUDES
} ${.ALLSRC
} |
sed
"s/^/${PROGC}: /" > ${DEPENDFILE}.new
mv
${DEPENDFILE}.new
${DEPENDFILE}
# if the program is composed of several object modules, the modules are
# the list of sources with the .o's translated to .c's. If no manual
# pages have been defined, it's in section 1 with the same name as the
# program. Objects depend on their C source counterparts.
.if
!defined
(MAN1
) && !defined
(MAN2
) && !defined
(MAN3
) && !defined
(MAN4
) && !defined
(MAN5
) && !defined
(MAN6
) && !defined
(MAN7
) && !defined
(MAN8
)
${PROGO}: ${OBJS} ${LIBC} ${SRCLIB}
${CC} ${LDFLAGS} -o
${.TARGET
} ${OBJS} ${LDLIB}
for entry in
${.ALLSRC
}; do
${CPP} -M
${CFLAGS
:M-
[ID
]*} ${.INCLUDES
} $$entry |
sed
"s/^/$$1: /" >> ${DEPENDFILE}.new
mv
${DEPENDFILE}.new
${DEPENDFILE}
# CLEANFILES -- list of files to be removed for the target clean;
# used, for example, to specify .c's produced from
JUNKFILES
= a.out Errs errs mklog core
rm -f
${PROGC} ${PROGO} ${OBJS} ${CLEANFILES} ${JUNKFILES}
rm -f
${MANALL} ${TAGSFILE} ${DEPENDFILE}
lint
${LINTFLAGS} ${CFLAGS} ${.ALLSRC
}
# MDIR -- default manual page installation directory
# MANMODE -- default manual page installation mode
# STRIP -- default strip flag
# BINMODE -- default binary installation mode
# BINOWN -- default binary owner
# BINGRP -- default binary group
MDIR?
= /usr
/share
/man
/cat
# install target -- creates manual pages, then installs the binaries,
# manual pages, and manual page links.
install ${STRIP} -o
${BINOWN} -g
${BINGRP} -m
${BINMODE} \
${PROGC} ${PROGO} ${DESTDIR}${DIR}
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN1} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN2} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN3} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN4} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN5} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN6} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN7} \
install -c
-o
${BINOWN} -g
${BINGRP} -m
${MANMODE} ${MAN8} \
# LINKS -- list of binary links of the form "link target
# link target"; for example, "/bin/[ /usr/bin/test"
# would link /bin/[ to /usr/bin/test"; not particularly
# labor saving, but prevents needing your own install
# MLINKS -- list of manual page linkes of the form "link target
# link target"; for example, "a.1 b.2 c.3 d.4" would
# link ${MDIR}1/a.0 to ${MDIR}2/b.0 and ${MDIR}3/c.0
if
`test $$# -lt 2`; then
ln
${DESTDIR}$$l ${DESTDIR}$$t
if
`test $$# -lt 2`; then
dir=${MDIR}`expr $$name : '[^\.]*\.\(.*\)'`
t
=${DESTDIR}$${dir}/`expr $$name : '\([^\.]*\)'`.0
dir=${MDIR}`expr $$name : '[^\.]*\.\(.*\)'`
l
=${DESTDIR}$${dir}/`expr $$name : '\([^\.]*\)'`.0