Subject: Re: "make release" in /usr/xsrc
To: Simon Burge <simonb@netbsd.org>
From: Frederick Bruckman <fb@enteract.com>
List: tech-install
Date: 12/21/1999 13:27:12
On Tue, 21 Dec 1999, Simon Burge wrote:
> John Darrow wrote:
>
> > One thing which I would suggest... instead of hardcoding ../src,
> > add some sort of a SRCDIR?=../src variable, and use that, so that it
> > can be overridden easily.
>
> We have "BSDSRCDIR" already - I think that should be used.
Yes, for consistency. It's not necessarily already defined, as
bsd.own.mk isn't included in xsrc, and I'm loathe to do so just for
this (side effects), but that's easy to deal with. For what it's
worth, I've included some explanatory text. No doubt it could be
clearer.
So how's this?
Index: Makefile
===================================================================
RCS file: /cvsroot/xsrc/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** Makefile 1999/09/27 08:56:05 1.8
--- Makefile 1999/12/21 19:26:03
***************
*** 1,6 ****
# $NetBSD: Makefile,v 1.8 1999/09/27 08:56:05 fredb Exp $
#
! # build and install xsrc
all: all-xc all-contrib
--- 1,33 ----
# $NetBSD: Makefile,v 1.8 1999/09/27 08:56:05 fredb Exp $
#
! # The principle targets in this makefile are named after the roughly
! # equivalent targets in the makefile of the main top-level NetBSD
! # source directory. These targets respond to a subset of the make
! # variables described there.
! #
! # Targets & Variables
! #
! # build: Clean out xsrc, and build and install everything that goes
! # under /usr/X11R6.
! #
! # DESTDIR -- Set to an alternative directory to install under.
! # UPDATE -- If set, don't make clean first, plus attempt to make
! # only the targets that are out of date.
! #
! # release snapshot: Same as build, plus tar up the X sets and install
! # them under the ${RELEASEDIR}/binary/sets directory.
! #
! # DESTDIR -- Same as for build. Mandatory for building a release.
! # RELEASEDIR -- As explained above.
! # BUILD_DONE -- If set, assume build is already done.
! # INSTALL_DONE -- If set, assume binaries to tar up are to be found
! # in ${DESTDIR} already.
! # BSDSRCDIR -- Set to the full path to the main source tree, /usr/src
! # by default. Needed to find ./distrib/sets.
! #
! # cleandir distclean: Remove all generated files from under xsrc.
! #
! # clean: Remove object files, but keep imake generated makefiles.
all: all-xc all-contrib
***************
*** 44,46 ****
--- 71,109 ----
.else
@${MAKE} cleandir all install
.endif
+
+ # release goo
+ #
+ .if !defined(DESTDIR)
+ release snapshot:
+ @echo setenv DESTDIR before doing that!
+ @false
+ .elif !defined(RELEASEDIR)
+ release snapshot:
+ @echo setenv RELEASEDIR before doing that!
+ @false
+ #
+ .else
+ #
+ .if defined(INSTALL_DONE)
+ release snapshot:
+ .elif defined(BUILD_DONE)
+ release snapshot: install
+ .else
+ release snapshot: build
+ #
+ .endif # INSTALL_DONE or BUILD_DONE
+ #
+ ${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets
+ sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ../src/distrib/sets \
+ -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
+ cd ${RELEASEDIR}/binary/sets && \
+ cksum -o 1 x*.tgz >>BSDSUM && \
+ cksum x*.tgz >>CKSUM && \
+ cksum -m x*.tgz >>MD5 && \
+ cksum -o 2 x*.tgz >>SYSVSUM
+ #
+ .endif # maketars exists and DESTDIR and RELEASEDIR check
+
+ .include "/etc/mk.conf"
+ BSDSRCDIR?= /usr/src