- compile common code once (into libcommon.a), and link that in.

cut's compilation time by half!
- build a common version.c in libcommon.a
- don't build version.h - nothing uses it
- comment out the ifdef INFO and -DINFO stuff - it's always compiled in
- XXX: don't compile mopprobe with -DNODL (which actually changes the
  compilation of stuff in common/*). nothing else does this, and it
  meant that mopprobe would have had different behaviour. if this behaviour
  is desired, a workaround can be put in place
This commit is contained in:
lukem
1997-10-16 07:36:12 +00:00
parent 0032f58a4b
commit 6d97281944
10 changed files with 39 additions and 89 deletions

View File

@@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.2 1997/03/25 03:06:58 thorpej Exp $
# $NetBSD: Makefile,v 1.3 1997/10/16 07:36:12 lukem Exp $
SUBDIR= mopd mopprobe moptrace mopchk mopa.out
SUBDIR= common mopa.out mopchk mopd mopprobe moptrace
.include <bsd.subdir.mk>

View File

@@ -1,6 +1,9 @@
# $NetBSD: Makefile.inc,v 1.3 1997/04/17 21:08:57 christos Exp $
# $NetBSD: Makefile.inc,v 1.4 1997/10/16 07:36:19 lukem Exp $
LIBCOMMON != cd ${.CURDIR}/../common;\
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -s -f-
CFLAGS+=-I${.CURDIR}/../common -I${.CURDIR}/..
DPADD+= ${LIBKVM} ${LIBCOMMON}/libcommon.a
LDADD+= -lkvm -L${LIBCOMMON} -lcommon
BINDIR?= /usr/sbin
CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../common
.PATH: ${.CURDIR}/../common

18
common/Makefile Normal file
View File

@@ -0,0 +1,18 @@
# $NetBSD: Makefile,v 1.1 1997/10/16 07:36:27 lukem Exp $
LIB= common
SRCS= cmp.c device.c dl.c file.c get.c loop-bsd.c mopdef.c nma.c pf.c \
print.c put.c rc.c version.c
CLEANFILES= version.c
version.c: VERSION
rm -f version.c; \
sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
NOPROFILE= noprofile
NOPIC= nopic
# only needed during build
libinstall::
.include <bsd.lib.mk>

View File

@@ -1,4 +1,4 @@
/* $NetBSD: file.c,v 1.2 1997/03/25 03:07:12 thorpej Exp $ */
/* $NetBSD: file.c,v 1.3 1997/10/16 07:36:31 lukem Exp $ */
/*
* Copyright (c) 1995-96 Mats O Jansson. All rights reserved.
@@ -30,7 +30,7 @@
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: file.c,v 1.2 1997/03/25 03:07:12 thorpej Exp $";
static char rcsid[] = "$NetBSD: file.c,v 1.3 1997/10/16 07:36:31 lukem Exp $";
#endif
#include "os.h"
@@ -186,43 +186,33 @@ GetMopFileInfo(fd, load, xfr)
header[iha+IHA_L_TFRADR1+2]*0x10000 +
header[iha+IHA_L_TFRADR1+1]*0x100 +
header[iha+IHA_L_TFRADR1]) & 0x7fffffff;
#ifdef INFO
printf("Native Image (VAX)\n");
printf("Header Block Count: %d\n",hbcnt);
printf("Image Size: %08x\n",isize);
printf("Load Address: %08x\n",load_addr);
printf("Transfer Address: %08x\n",xfr_addr);
#endif
break;
case IHD_C_RSX: /* RSX image produced by TKB */
hbcnt = header[L_BBLK+1]*256 + header[L_BBLK];
isize = (header[L_BLDZ+1]*256 + header[L_BLDZ]) * 64;
load_addr = header[L_BSA+1]*256 + header[L_BSA];
xfr_addr = header[L_BXFR+1]*256 + header[L_BXFR];
#ifdef INFO
printf("RSX Image\n");
printf("Header Block Count: %d\n",hbcnt);
printf("Image Size: %08x\n",isize);
printf("Load Address: %08x\n",load_addr);
printf("Transfer Address: %08x\n",xfr_addr);
#endif
break;
case IHD_C_BPA: /* BASIC plus analog */
#ifdef INFO
printf("BASIC-Plus Image, not supported\n");
#endif
return(-1);
break;
case IHD_C_ALIAS: /* Alias */
#ifdef INFO
printf("Alias, not supported\n");
#endif
return(-1);
break;
case IHD_C_CLI: /* Image is CLI */
#ifdef INFO
printf("CLI, not supported\n");
#endif
return(-1);
break;
case IHD_C_PMAX: /* PMAX system image */
@@ -239,13 +229,11 @@ GetMopFileInfo(fd, load, xfr)
header[iha+IHA_L_TFRADR1+2]*0x10000 +
header[iha+IHA_L_TFRADR1+1]*0x100 +
header[iha+IHA_L_TFRADR1]);
#ifdef INFO
printf("PMAX Image \n");
printf("Header Block Count: %d\n",hbcnt);
printf("Image Size: %08x\n",isize);
printf("Load Address: %08x\n",load_addr);
printf("Transfer Address: %08x\n",xfr_addr);
#endif
break;
case IHD_C_ALPHA: /* ALPHA system image */
isd = (header[EIHD_L_ISDOFF+3]*0x1000000 +
@@ -262,18 +250,14 @@ GetMopFileInfo(fd, load, xfr)
header[isd+EISD_L_SECSIZE]);
load_addr = 0;
xfr_addr = 0;
#ifdef INFO
printf("Alpha Image \n");
printf("Header Block Count: %d\n",hbcnt);
printf("Image Size: %08x\n",isize);
printf("Load Address: %08x\n",load_addr);
printf("Transfer Address: %08x\n",xfr_addr);
#endif
break;
default:
#ifdef INFO
printf("Unknown Image (%d)\n",image_type);
#endif
return(-1);
}
@@ -528,7 +512,6 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill,
/*###525 [cc] syntax error before `}'%%%*/
}
#ifdef INFO
printf("a.out image (");
switch (N_GETMID (ex)) {
case MID_I386:
@@ -604,7 +587,7 @@ GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill,
printf("Transfer Address: %08x\n",ex.a_entry);
printf("Size of reloc text: %08x\n",ex.a_trsize);
printf("Size of reloc data: %08x\n",ex.a_drsize);
#endif
magic = N_GETMAGIC (ex);
clbytes = getCLBYTES(mid);
clofset = clbytes - 1;

View File

@@ -1,6 +1,5 @@
# $NetBSD: Makefile,v 1.4 1997/04/17 21:09:02 christos Exp $
# $NetBSD: Makefile,v 1.5 1997/10/16 07:36:37 lukem Exp $
PROG= mopa.out
SRCS= mopa.out.c file.c
.include <bsd.prog.mk>

View File

@@ -1,18 +1,5 @@
# $NetBSD: Makefile,v 1.5 1997/04/17 21:09:09 christos Exp $
# $NetBSD: Makefile,v 1.6 1997/10/16 07:36:44 lukem Exp $
PROG= mopchk
SRCS= mopchk.c device.c version.c pf.c loop-bsd.c file.c
CFLAGS+= -DINFO
CLEANFILES= version.c version.h
LDADD= -lkvm
DPADD= ${LIBKVM}
version.c version.h: ${.CURDIR}/../common/VERSION
rm -f version.c; \
sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
echo '#define VERSION_MINOR' $$2 ; } > version.h
.include <bsd.prog.mk>

View File

@@ -1,4 +1,4 @@
/* $NetBSD: mopchk.c,v 1.4 1997/04/17 21:09:12 christos Exp $ */
/* $NetBSD: mopchk.c,v 1.5 1997/10/16 07:36:50 lukem Exp $ */
/*
* Copyright (c) 1995-96 Mats O Jansson. All rights reserved.
@@ -30,7 +30,7 @@
*/
#ifndef LINT
static char rcsid[] = "$NetBSD: mopchk.c,v 1.4 1997/04/17 21:09:12 christos Exp $";
static char rcsid[] = "$NetBSD: mopchk.c,v 1.5 1997/10/16 07:36:50 lukem Exp $";
#endif
/*
@@ -64,7 +64,7 @@ int AllFlag = 0; /* listen on "all" interfaces */
int VersionFlag = 0; /* Show version */
int promisc = 0; /* promisc mode not needed */
char *Program;
char version[];
extern char version[];
void
main(argc, argv)
@@ -76,8 +76,6 @@ main(argc, argv)
struct if_info *ii;
int err, aout;
extern int optind, opterr;
if ((Program = strrchr(argv[0], '/')))
Program++;
else

View File

@@ -1,19 +1,7 @@
# $NetBSD: Makefile,v 1.6 1997/04/17 21:09:17 christos Exp $
# $NetBSD: Makefile,v 1.7 1997/10/16 07:36:58 lukem Exp $
PROG= mopd
SRCS= mopd.c process.c print.c cmp.c get.c put.c mopdef.c nma.c device.c \
version.c pf.c loop-bsd.c dl.c rc.c file.c
SRCS= mopd.c process.c
MAN= mopd.8
CLEANFILES= version.c version.h
LDADD= -lkvm
DPADD= ${LIBKVM}
version.c version.h: ${.CURDIR}/../common/VERSION
rm -f version.c; \
sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
echo '#define VERSION_MINOR' $$2 ; } > version.h
.include <bsd.prog.mk>

View File

@@ -1,17 +1,5 @@
# $NetBSD: Makefile,v 1.5 1997/04/17 21:09:25 christos Exp $
# $NetBSD: Makefile,v 1.6 1997/10/16 07:37:04 lukem Exp $
PROG= mopprobe
SRCS= mopprobe.c device.c get.c cmp.c mopdef.c version.c pf.c loop-bsd.c
CFLAGS+= -DNODL
CLEANFILES= version.c version.h
LDADD= -lkvm
DPADD= ${LIBKVM}
version.c version.h: ${.CURDIR}/../common/VERSION
rm -f version.c; \
sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
echo '#define VERSION_MINOR' $$2 ; } > version.h
.include <bsd.prog.mk>

View File

@@ -1,19 +1,5 @@
# $NetBSD: Makefile,v 1.5 1997/04/17 21:09:31 christos Exp $
# $NetBSD: Makefile,v 1.6 1997/10/16 07:37:09 lukem Exp $
PROG= moptrace
SRCS= moptrace.c print.c cmp.c get.c mopdef.c nma.c device.c version.c pf.c \
loop-bsd.c dl.c rc.c
MAN= moptrace.1
CLEANFILES= version.c version.h
LDADD= -lkvm
DPADD= ${LIBKVM}
version.c version.h: ${.CURDIR}/../common/VERSION
rm -f version.c; \
sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
echo '#define VERSION_MINOR' $$2 ; } > version.h
.include <bsd.prog.mk>