From owner-freebsd-current Sat May 4 17:17:36 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA20146 for current-outgoing; Sat, 4 May 1996 17:17:36 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA20125 for ; Sat, 4 May 1996 17:17:32 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id KAA01448; Sun, 5 May 1996 10:13:40 +1000 Date: Sun, 5 May 1996 10:13:40 +1000 From: Bruce Evans Message-Id: <199605050013.KAA01448@godzilla.zeta.org.au> To: wollman@lcs.mit.edu, wosch@cs.tu-berlin.de Subject: Re: Files installed to /etc, (was: review request) Cc: current@FreeBSD.ORG Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >The target `scriptinstall' works for all script languages extensions >(.sh, .csh, .perl, .pl, .tcl, .el) and you can install more than one >script (PROG support only one program). FreeBSD has ~33 bourne shell >scripts, 9 perl scripts and 1 csh script. You can support all the extensions without using the `scriptinstall' by adding implicit rules. It would be nice to support multiple programs in general for the case where there is only one source file per program and a simple rule for transforming the source name to the target name. Trivial makefiles already get the build step right: $ echo 'all: foo bar' >makefile $ touch foo.c bar.sh $ make -n cc -O2 foo.c -o foo cp -p bar.sh bar chmod a+x bar This could be made to work in the bsd.prog.mk framework without depending on implicit rules. E.g., use ${PROGS} for the list of simple programs and substitute in it to get the C programs, etc, and generate an explicit rule for each. ... Here is an half finished implementation. The obj directory stuff isn't quite right. I cut this out of bsd.man.mk and deleted one too many complication from the install rule. === PROGS= foo bar # .include # --- Explicitly included first version of bsd.simpleprog.mk ---. all: all-progs # XXX install: all-progs-install # XXX all-progs: ${PROGS} .for prog in ${PROGS} .if exists(${prog:S/$/.c/}) ${prog}: ${prog:S/$/.o/} cc ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} ${prog:S/$/.o/}: ${prog:S/$/.c/} cc -c ${CFLAGS} ${.ALLSRC} -o ${.TARGET} .endif .if exists(${prog:S/$/.sh/}) ${prog}: ${prog:S/$/.sh/} # Just forget about default .sh rule. # XXX should delete it from .SUFFIXES. .endif .endfor all-progs-install:: .for prog in ${PROGS} all-progs-install:: ${prog} .if exists(${prog:S/$/.c/}) ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${prog} ${DESTDIR}${BINDIR}/${prog} .endif .if exists(${prog:S/$/.sh/}) ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${prog:S/$/.sh/} ${DESTDIR}${BINDIR}/${prog} .endif .endfor # --- End of explicitly included bsd.simpleprog.mk ---. .include === Bruce