Date: Fri, 17 Apr 1998 12:03:22 +0200 (CEST) From: arnej@math.ntnu.no To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/6330: "make install" should not touch the obj tree Message-ID: <199804171003.MAA11252@cauchy.math.ntnu.no>
next in thread | raw e-mail | index | archive | help
>Number: 6330 >Category: bin >Synopsis: "make install" should not touch the obj tree >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 17 03:10:01 PDT 1998 >Last-Modified: >Originator: Arne Henrik Juul >Organization: Norwegian University og Technology and Science >Release: FreeBSD 2.2.6-STABLE i386 >Environment: I've been using this patch for some time now in the 2.2 branch. >Description: It should be possible to do a "make install" even if your /usr/src and /usr/obj are mounted read-only (e.g. with NFS from another machine, as I do). However, in two places "make install" builds files in the obj tree on the fly, then installs them. >How-To-Repeat: mount -u -r /usr/src mount -u -r /usr/obj cd /usr/src; make install >Fix: Apply the patch below. The first one should be pretty straight-forward (modulo style guidelines for Makefiles), and applies to -current unchanged. The second changes how osreldate.h is created the same way it was already changed in -current (rev 1.55). Index: src/gnu/usr.bin/groff/tmac/Makefile =================================================================== RCS file: /usr/cvs/src/gnu/usr.bin/groff/tmac/Makefile,v retrieving revision 1.12.2.1 diff -u -r1.12.2.1 Makefile --- Makefile 1998/03/03 06:37:09 1.12.2.1 +++ Makefile 1998/04/15 10:14:02 @@ -11,7 +11,7 @@ LINKS= ${TMACDIR}/tmac.andoc ${TMACDIR}/tmac.an MANDEPEND= ${MAN7} -CLEANFILES+= temp ${MANDEPEND} tmac.groff_an +CLEANFILES+= temp ${MANDEPEND} tmac.groff_an *.strip *.mdoc FILES= tmac.andoc tmac.pic tmac.ps tmac.psnew tmac.psold\ tmac.pspic tmac.psatk tmac.dvi tmac.tty tmac.tty-char tmac.X\ @@ -19,29 +19,41 @@ STRIPFILES= tmac.e tmac.s tmac.doc MDOCFILES= doc-common doc-ditroff doc-nroff doc-syms +SFILES = ${STRIPFILES:S;$;.strip;} +MFILES = ${MDOCFILES:S;$;.mdoc;} +all: tmac.groff_an ${SFILES} ${MFILES} + +${SFILES}: + for f in ${STRIPFILES}; do \ + sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/$$f > $$f.strip; \ + done + +${MFILES}: + for f in ${MDOCFILES}; do \ + sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/$$f > $$f.mdoc; \ + done + +tmac.groff_an: + sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/tmac.an >tmac.groff_an + beforeinstall: for f in ${FILES}; do \ - ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ + ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ ${DIST_DIR}/$$f ${DESTDIR}${TMACDIR}; \ done - sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/tmac.an >tmac.groff_an ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ tmac.groff_an ${DESTDIR}${TMACDIR} for f in ${STRIPFILES}; do \ - rm -f temp; \ - sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/$$f >temp; \ ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - temp ${DESTDIR}${TMACDIR}/$$f; \ + $$f.strip ${DESTDIR}${TMACDIR}/$$f; \ done for f in ${MDOCFILES}; do \ - rm -f temp; \ - sed -f ${DIST_DIR}/strip.sed ${DIST_DIR}/$$f >temp; \ ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - temp ${DESTDIR}${MDOCDIR}/$$f; \ + $$f.mdoc ${DESTDIR}${MDOCDIR}/$$f; \ done test -f ${DESTDIR}${TMACDIR}/man.local || \ - ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ + ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ ${DIST_DIR}/man.local ${DESTDIR}${TMACDIR} .include "../Makefile.cfg" Index: src/include/Makefile =================================================================== RCS file: /usr/cvs/src/include/Makefile,v retrieving revision 1.45.2.8 diff -u -r1.45.2.8 Makefile --- Makefile 1998/02/01 16:21:52 1.45.2.8 +++ Makefile 1998/04/17 09:58:08 @@ -6,7 +6,7 @@ # The ``rm -rf''s used below are safe because rm doesn't follow symbolic # links. # -all depend lint tags: +depend lint tags: CLEANFILES= osreldate.h version vers.c SUBDIR= rpcsvc @@ -45,6 +45,24 @@ #SHARED= symlinks SHARED?= copies + +.if exists (${.CURDIR}/../sys/conf/newvers.sh) +all: osreldate.h + +osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh + @${ECHO} creating osreldate.h from newvers.sh + . ${.CURDIR}/../sys/conf/newvers.sh; \ + echo "$$COPYRIGHT" > osreldate.h; \ + echo \#'undef __FreeBSD_version' >> osreldate.h; \ + echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h +.else +all: + @${ECHO} creating osreldate.h from sysctl info + echo \#'undef __FreeBSD_version' > osreldate.h + echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ + >> osreldate.h +.endif + beforeinstall: installhdrs ${SHARED} .if make(installhdrs) @@ -63,19 +81,6 @@ cd ${.CURDIR}/rpc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${RPCFILES} ${DESTDIR}/usr/include/rpc - @rm -f osreldate.h -.if exists (${.CURDIR}/../sys/conf/newvers.sh) - @${ECHO} creating osreldate.h from newvers.sh - . ${.CURDIR}/../sys/conf/newvers.sh; \ - echo "$$COPYRIGHT" > osreldate.h; \ - echo \#'undef __FreeBSD_version' >> osreldate.h; \ - echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h -.else - @${ECHO} creating osreldate.h from sysctl info - @echo \#'undef __FreeBSD_version' > osreldate.h - @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ - >> osreldate.h -.endif ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.OBJDIR}/osreldate.h \ ${DESTDIR}/usr/include >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804171003.MAA11252>