Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin - build with obj dirs.



details:   https://anonhg.NetBSD.org/src/rev/a6bd3e354cf7
branches:  trunk
changeset: 474582:a6bd3e354cf7
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 12 04:13:34 1999 +0000

description:
- 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.

diffstat:

 usr.bin/kdump/Makefile         |   6 +--
 usr.bin/kdump/Makefile.ioctl-c |   5 ++
 usr.bin/ktruss/Makefile        |  49 ++++++++------------------
 usr.bin/ktruss/dump.c          |   4 +-
 usr.bin/ktruss/makeerrnos      |  62 ----------------------------------
 usr.bin/ktruss/makeerrnos.sh   |  75 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 101 insertions(+), 100 deletions(-)

diffs (249 lines):

diff -r 452479507050 -r a6bd3e354cf7 usr.bin/kdump/Makefile
--- a/usr.bin/kdump/Makefile    Mon Jul 12 03:24:58 1999 +0000
+++ b/usr.bin/kdump/Makefile    Mon Jul 12 04:13:34 1999 +0000
@@ -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 @@
 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>
diff -r 452479507050 -r a6bd3e354cf7 usr.bin/kdump/Makefile.ioctl-c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/kdump/Makefile.ioctl-c    Mon Jul 12 04:13:34 1999 +0000
@@ -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
diff -r 452479507050 -r a6bd3e354cf7 usr.bin/ktruss/Makefile
--- a/usr.bin/ktruss/Makefile   Mon Jul 12 03:24:58 1999 +0000
+++ b/usr.bin/ktruss/Makefile   Mon Jul 12 04:13:34 1999 +0000
@@ -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 $
-
-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
+#      $NetBSD: Makefile,v 1.2 1999/07/12 04:13:34 mrg Exp $
 
-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 )
+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=
 
 dump.c: misc.h
-
-misc.c: /usr/include/sys/errno.h /usr/include/sys/signal.h
-       ./makeerrnos
+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.h: /usr/include/sys/errno.h /usr/include/sys/signal.h
-       ./makeerrnos
+.include "${.CURDIR}/../kdump/Makefile.ioctl-c"
+.include <bsd.prog.mk>
 
-.include <bsd.prog.mk>
+.PATH: ${.CURDIR}/../ktrace ${.CURDIR}/../kdump
diff -r 452479507050 -r a6bd3e354cf7 usr.bin/ktruss/dump.c
--- a/usr.bin/ktruss/dump.c     Mon Jul 12 03:24:58 1999 +0000
+++ b/usr.bin/ktruss/dump.c     Mon Jul 12 04:13:34 1999 +0000
@@ -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 @@
 #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>
diff -r 452479507050 -r a6bd3e354cf7 usr.bin/ktruss/makeerrnos
--- a/usr.bin/ktruss/makeerrnos Mon Jul 12 03:24:58 1999 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-:
-cat <<__EOF__ > misc.c
-#include "misc.h"
-
-struct systab errnos[] = {
-__EOF__
-cat /usr/include/sys/errno.h | cpp -dM ${1+"$@"} |
-awk '
-/^#[   ]*define[       ]*E[A-Z0-9]*[   ]*[0-9-][0-9]*[         ]*.*/ {
-       for (i = 1; i <= NF; i++)
-               if ($i ~ /define/) 
-                       break;
-       i++;
-       j = i + 1;
-       #
-       printf("\t{ \"%s\", %s },\n", $i, $j);
-}
-END {
-       print " { \"0\", 0 },\n";
-}
-' | sort -n +2 >> misc.c
-echo " { 0L, 0},
-};" >> misc.c
-lines=`wc -l misc.c|awk ' { print $1; } ' -`
-lines=`expr $lines - 4`
-
-cat <<__EOF__ >> misc.c
-
-struct systab signals[] = {
-__EOF__
-cat /usr/include/sys/signal.h | cpp -dM ${1+"$@"} |
-awk '
-/^#[   ]*define[       ]*S[A-Z0-9]*[   ]*[0-9-][0-9]*[         ]*.*/ {
-       for (i = 1; i <= NF; i++)
-               if ($i ~ /define/) 
-                       break;
-       i++;
-       j = i + 1;
-       #
-       printf("\t{ \"%s\", %s },\n", $i, $j);
-}
-END {
-       print " { \"0\", 0 },\n";
-}
-' | sort -n +2 >> misc.c
-echo " { 0L, 0},
-};" >> misc.c
-elines=`grep '{ "SIG' misc.c | wc -l`
-elines=`expr $elines + 1`
-
-cat <<__EOF__ >misc.h
-struct systab  {
-       char    *name;
-       int     value;
-};
-
-extern struct systab errnos[$lines + 1];
-extern struct systab signals[$elines + 1];
-
-#define        MAXERRNOS       $lines
-#define        MAXSIGNALS      $elines
-__EOF__
diff -r 452479507050 -r a6bd3e354cf7 usr.bin/ktruss/makeerrnos.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/ktruss/makeerrnos.sh      Mon Jul 12 04:13:34 1999 +0000
@@ -0,0 +1,75 @@
+#! /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 ${DESTDIR}/usr/include/sys/errno.h | cpp -dM |
+awk '
+/^#[   ]*define[       ]*E[A-Z0-9]*[   ]*[0-9-][0-9]*[         ]*.*/ {
+       for (i = 1; i <= NF; i++)
+               if ($i ~ /define/) 
+                       break;
+       i++;
+       j = i + 1;
+       #
+       printf("\t{ \"%s\", %s },\n", $i, $j);
+}
+END {
+       print " { \"0\", 0 },\n";
+}
+' | sort -n +2 >> $CFILE
+echo " { 0L, 0},
+};" >> $CFILE
+lines=`wc -l $CFILE|awk ' { print $1; } ' -`
+lines=`expr $lines - 4`
+
+cat <<__EOF__ >> $CFILE
+
+struct systab signals[] = {
+__EOF__
+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++)
+               if ($i ~ /define/) 
+                       break;
+       i++;
+       j = i + 1;
+       #
+       printf("\t{ \"%s\", %s },\n", $i, $j);
+}
+END {
+       print " { \"0\", 0 },\n";
+}
+' | sort -n +2 >> $CFILE
+echo " { 0L, 0},
+};" >> $CFILE
+elines=`grep '{ "SIG' $CFILE | wc -l`
+elines=`expr $elines + 1`
+
+cat <<__EOF__ >$HFILE
+struct systab  {
+       char    *name;
+       int     value;
+};
+
+extern struct systab errnos[$lines + 1];
+extern struct systab signals[$elines + 1];
+
+#define        MAXERRNOS       $lines
+#define        MAXSIGNALS      $elines
+__EOF__



Home | Main Index | Thread Index | Old Index