From ced716c30fee118f9deecab56ddbd969f77d32b6 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Sat, 17 Jan 1998 14:21:21 +0000 Subject: [PATCH] Remove the necessity of -ldes and -lalias etc from release/Makefile. When building a release, RELEASE_CRUNCH is defined for a `make' of the objects required by the crunch of each program. The object list is still obtained in the same way, so you must make sure that all objects are built (empty if necessary) by this make. ppp/Makefile provides an example. Reviewed by: jkh --- release/Makefile | 6 +++--- release/alpha/boot_crunch.conf | 6 +++--- release/amd64/boot_crunch.conf | 6 +++--- release/boot_crunch.conf | 6 +++--- release/i386/boot_crunch.conf | 6 +++--- release/pc98/boot_crunch.conf | 6 +++--- usr.sbin/crunch/crunchgen/crunchgen.c | 9 ++++++++- usr.sbin/ppp/Makefile | 15 ++++++++++++--- 8 files changed, 38 insertions(+), 22 deletions(-) diff --git a/release/Makefile b/release/Makefile index 1c802ac383b..85e1e923917 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.331 1997/10/05 22:31:40 jkh Exp $ +# $Id: Makefile,v 1.332 1997/10/20 21:57:14 joerg Exp $ # # make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ] # @@ -294,8 +294,8 @@ release.4: mkdir $${j}_crunch && \ ( cd $${j}_crunch && \ crunchgen ${.CURDIR}/$${j}_crunch.conf && \ - ${MAKE} -f $${j}_crunch.mk all NOCRYPT=yes \ - "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ + ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all + NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ true || { rm -rf $${j}_crunch ; false ; } ; \ done diff --git a/release/alpha/boot_crunch.conf b/release/alpha/boot_crunch.conf index 4d3cbbf666a..b98ceeb026e 100644 --- a/release/alpha/boot_crunch.conf +++ b/release/alpha/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.31 1997/09/30 23:58:24 jkh Exp $ +# $Id: boot_crunch.conf,v 1.32 1997/12/04 14:22:01 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx -ldes +libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lz +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/release/amd64/boot_crunch.conf b/release/amd64/boot_crunch.conf index 4d3cbbf666a..b98ceeb026e 100644 --- a/release/amd64/boot_crunch.conf +++ b/release/amd64/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.31 1997/09/30 23:58:24 jkh Exp $ +# $Id: boot_crunch.conf,v 1.32 1997/12/04 14:22:01 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx -ldes +libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lz +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/release/boot_crunch.conf b/release/boot_crunch.conf index 4d3cbbf666a..b98ceeb026e 100644 --- a/release/boot_crunch.conf +++ b/release/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.31 1997/09/30 23:58:24 jkh Exp $ +# $Id: boot_crunch.conf,v 1.32 1997/12/04 14:22:01 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx -ldes +libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lz +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/release/i386/boot_crunch.conf b/release/i386/boot_crunch.conf index 4d3cbbf666a..b98ceeb026e 100644 --- a/release/i386/boot_crunch.conf +++ b/release/i386/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.31 1997/09/30 23:58:24 jkh Exp $ +# $Id: boot_crunch.conf,v 1.32 1997/12/04 14:22:01 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx -ldes +libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lz +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/release/pc98/boot_crunch.conf b/release/pc98/boot_crunch.conf index 4d3cbbf666a..b98ceeb026e 100644 --- a/release/pc98/boot_crunch.conf +++ b/release/pc98/boot_crunch.conf @@ -1,4 +1,4 @@ -# $Id: boot_crunch.conf,v 1.31 1997/09/30 23:58:24 jkh Exp $ +# $Id: boot_crunch.conf,v 1.32 1997/12/04 14:22:01 jkh Exp $ srcdirs /usr/src/bin /usr/src/sbin /usr/src/release /usr/src/usr.bin srcdirs /usr/src/gnu/usr.bin /usr/src/usr.sbin /usr/src/sbin/i386 @@ -11,5 +11,5 @@ ln gzip gunzip ln gzip zcat ln sh -sh -libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lalias -lz -libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx -ldes +libs -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpio -lz +libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index ae0a78ffc0f..946cbd13bcb 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -748,6 +748,9 @@ void top_makefile_rules(FILE *outmk) fprintf(outmk, "SUBMAKE_TARGETS="); for(p = progs; p != NULL; p = p->next) fprintf(outmk, " %s_make", p->ident); + fprintf(outmk, "\nSUBCLEAN_TARGETS="); + for(p = progs; p != NULL; p = p->next) + fprintf(outmk, " %s_clean", p->ident); fprintf(outmk, "\n\n"); fprintf(outmk, "%s: %s.o $(CRUNCHED_OBJS)\n", @@ -757,8 +760,10 @@ void top_makefile_rules(FILE *outmk) fprintf(outmk, "\tstrip %s\n", execfname); fprintf(outmk, "all: objs exe\nobjs: $(SUBMAKE_TARGETS)\n"); fprintf(outmk, "exe: %s\n", execfname); + fprintf(outmk, "realclean: clean subclean\n"); fprintf(outmk, "clean:\n\trm -f %s *.lo *.o *_stub.c\n", execfname); + fprintf(outmk, "subclean: $(SUBCLEAN_TARGETS)\n"); } @@ -773,8 +778,10 @@ void prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_OBJS=", p->ident); output_strlst(outmk, p->objs); fprintf(outmk, "%s_make:\n", p->ident); - fprintf(outmk, "\t(cd $(%s_SRCDIR) && make depend && make $(%s_OBJS))\n\n", + fprintf(outmk, "\t(cd $(%s_SRCDIR) && make depend && make $(%s_OBJS))\n", p->ident, p->ident); + fprintf(outmk, "%s_clean:\n", p->ident); + fprintf(outmk, "\t(cd $(%s_SRCDIR) && make clean)\n\n", p->ident); } else fprintf(outmk, "%s_make:\n\t@echo \"** cannot make objs for %s\"\n\n", diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile index 40ecd39dd2e..e67406b5886 100644 --- a/usr.sbin/ppp/Makefile +++ b/usr.sbin/ppp/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.33 1997/12/03 10:23:44 brian Exp $ +# $Id: Makefile,v 1.34 1997/12/13 02:37:20 brian Exp $ PROG= ppp SRCS= arp.c async.c auth.c ccp.c chap.c chat.c command.c deflate.c \ @@ -14,17 +14,26 @@ BINMODE=4550 BINOWN= root BINGRP= network -.if defined(NOALIAS) +.if defined(NOALIAS) || defined(RELEASE_CRUNCH) CFLAGS+=-DNOALIAS .else SRCS+= alias_cmd.c loadalias.c .endif -.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE) +.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE) && !defined(RELEASE_CRUNCH) CFLAGS+=-DHAVE_DES SRCS+= chap_ms.c LDADD+= -ldes DPADD+= ${LIBDES} .endif +.if defined(RELEASE_CRUNCH) +# We must create these objects because the crunchgen will link them, +# and we don't want any unused symbols to spoil the final link. +SRCS+= alias_cmd.c loadalias.c chap_ms.c +chap_ms.o alias_cmd.o loadalias.o: + >null_$*.c + cc -c -o $@ null_$*.c +.endif + .include