- build with obj dirs.
- use .PATH not broken links - share the make fragment to build "ioctl.c" - general clean up, RCSID, etc. this is all happy now AFAICT.
This commit is contained in:
parent
b7eb8dab03
commit
9abab6de8b
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.12 1998/10/04 10:49:58 veego Exp $
|
||||
# $NetBSD: Makefile,v 1.13 1999/07/12 04:13:34 mrg Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
@ -10,8 +10,6 @@ SRCS= kdump.c ioctl.c subr.c
|
|||
LDSTATIC?=-static
|
||||
CLEANFILES+=ioctl.c
|
||||
|
||||
ioctl.c: mkioctls ${DESTDIR}/usr/include/sys/ioctl.h ${DESTDIR}/usr/include/sys/ioctl_compat.h
|
||||
/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include/sys/ioctl.h \
|
||||
${DESTDIR}/usr/include/sys/ioctl_compat.h > ioctl.c
|
||||
.include "Makefile.ioctl-c"
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# $NetBSD: Makefile.ioctl-c,v 1.1 1999/07/12 04:13:34 mrg Exp $
|
||||
|
||||
ioctl.c: mkioctls ${DESTDIR}/usr/include/sys/ioctl.h ${DESTDIR}/usr/include/sys/ioctl_compat.h
|
||||
/bin/sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include/sys/ioctl.h \
|
||||
${DESTDIR}/usr/include/sys/ioctl_compat.h > ioctl.c
|
|
@ -1,38 +1,21 @@
|
|||
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
# $Id: Makefile,v 1.1 1999/07/12 03:20:17 darrenr Exp $
|
||||
# $NetBSD: Makefile,v 1.2 1999/07/12 04:13:34 mrg Exp $
|
||||
|
||||
PROG= ktruss
|
||||
SRCS= ktrace.c dump.c subr.c ioctl.c misc.c
|
||||
LDSTATIC?= -static
|
||||
CPPFLAGS+= -I. -I${.CURDIR}/../ktrace -I${.CURDIR}/../../sys -DKTRUSS
|
||||
LDSTATIC?= -static
|
||||
CLEANFILES+= misc.c misc.h ioctl.c
|
||||
MAN=
|
||||
LDSTATIC?=-static
|
||||
PROG= ktruss
|
||||
CFLAGS+=-g -I${.CURDIR}/../ktrace -I/sys -DKTRUSS
|
||||
SRCS= ktrace.c dump.c subr.c ioctl.c misc.c
|
||||
CLEANFILES+=misc.c misc.h ktrace.c subr.c ioctl.c
|
||||
|
||||
ktruss: links
|
||||
|
||||
links: ktrace.c subr.c ioctl.c
|
||||
|
||||
ktrace.c: ../ktrace/ktrace.c
|
||||
rm -f ktrace.c
|
||||
ln -s ../ktrace/ktrace.c .
|
||||
|
||||
subr.c: ../ktrace/subr.c
|
||||
rm -f subr.c
|
||||
ln -s ../ktrace/subr.c .
|
||||
|
||||
ioctl.c: ../kdump/ioctl.c
|
||||
rm -f ioctl.c
|
||||
ln -s ../kdump/ioctl.c .
|
||||
|
||||
../kdump/ioctl.c: ../kdump/mkioctls
|
||||
(cd ../kdump; make ioctl.c )
|
||||
|
||||
dump.c: misc.h
|
||||
misc.c misc.h: ${DESTDIR}/usr/include/sys/errno.h \
|
||||
${DESTDIR}/usr/include/sys/signal.h
|
||||
${.CURDIR}/makeerrnos.sh \
|
||||
${DESTDIR}/usr/include/sys/errno.h \
|
||||
${DESTDIR}/usr/include/sys/signal.h misc
|
||||
|
||||
misc.c: /usr/include/sys/errno.h /usr/include/sys/signal.h
|
||||
./makeerrnos
|
||||
|
||||
misc.h: /usr/include/sys/errno.h /usr/include/sys/signal.h
|
||||
./makeerrnos
|
||||
|
||||
.include "${.CURDIR}/../kdump/Makefile.ioctl-c"
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${.CURDIR}/../ktrace ${.CURDIR}/../kdump
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* $NetBSD: dump.c,v 1.2 1999/07/12 04:13:34 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -41,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
|
||||
#endif
|
||||
__RCSID("$NetBSD: dump.c,v 1.1 1999/07/12 03:20:17 darrenr Exp $");
|
||||
__RCSID("$NetBSD: dump.c,v 1.2 1999/07/12 04:13:34 mrg Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
:
|
||||
cat <<__EOF__ > misc.c
|
||||
#! /bin/sh
|
||||
#
|
||||
# $NetBSD: makeerrnos.sh,v 1.1 1999/07/12 04:13:34 mrg Exp $
|
||||
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "usage: makeerrnos.sh errno.h signal.h output"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
ERRNOH=$1
|
||||
SIGNALH=$2
|
||||
CFILE=$3.c
|
||||
HFILE=$3.h
|
||||
|
||||
cat <<__EOF__ > $CFILE
|
||||
#include "misc.h"
|
||||
|
||||
struct systab errnos[] = {
|
||||
__EOF__
|
||||
cat /usr/include/sys/errno.h | cpp -dM ${1+"$@"} |
|
||||
cat ${DESTDIR}/usr/include/sys/errno.h | cpp -dM |
|
||||
awk '
|
||||
/^#[ ]*define[ ]*E[A-Z0-9]*[ ]*[0-9-][0-9]*[ ]*.*/ {
|
||||
for (i = 1; i <= NF; i++)
|
||||
|
@ -18,17 +31,17 @@ awk '
|
|||
END {
|
||||
print " { \"0\", 0 },\n";
|
||||
}
|
||||
' | sort -n +2 >> misc.c
|
||||
' | sort -n +2 >> $CFILE
|
||||
echo " { 0L, 0},
|
||||
};" >> misc.c
|
||||
lines=`wc -l misc.c|awk ' { print $1; } ' -`
|
||||
};" >> $CFILE
|
||||
lines=`wc -l $CFILE|awk ' { print $1; } ' -`
|
||||
lines=`expr $lines - 4`
|
||||
|
||||
cat <<__EOF__ >> misc.c
|
||||
cat <<__EOF__ >> $CFILE
|
||||
|
||||
struct systab signals[] = {
|
||||
__EOF__
|
||||
cat /usr/include/sys/signal.h | cpp -dM ${1+"$@"} |
|
||||
cat ${DESTDIR}/usr/include/sys/signal.h | cpp -dM |
|
||||
awk '
|
||||
/^#[ ]*define[ ]*S[A-Z0-9]*[ ]*[0-9-][0-9]*[ ]*.*/ {
|
||||
for (i = 1; i <= NF; i++)
|
||||
|
@ -42,13 +55,13 @@ awk '
|
|||
END {
|
||||
print " { \"0\", 0 },\n";
|
||||
}
|
||||
' | sort -n +2 >> misc.c
|
||||
' | sort -n +2 >> $CFILE
|
||||
echo " { 0L, 0},
|
||||
};" >> misc.c
|
||||
elines=`grep '{ "SIG' misc.c | wc -l`
|
||||
};" >> $CFILE
|
||||
elines=`grep '{ "SIG' $CFILE | wc -l`
|
||||
elines=`expr $elines + 1`
|
||||
|
||||
cat <<__EOF__ >misc.h
|
||||
cat <<__EOF__ >$HFILE
|
||||
struct systab {
|
||||
char *name;
|
||||
int value;
|
Loading…
Reference in New Issue