Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Mar 2003 15:25:21 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov <ru@FreeBSD.org>
Subject:   Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh
Message-ID:  <XFMail.20030306152521.jhb@FreeBSD.org>
In-Reply-To: <20030306200858.GA41375@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 06-Mar-2003 David O'Brien wrote:
>> In any case, it's not _stupid_, as the default behavior of
>> SCRIPTSNAME of stripping extensions fits 99% of cases, and
>> it was designed bearing this in mind.
> 
> Huh??  SCRIPTSNAME is only used when you need to over ride the default
> behavior.  Perhaps you are talking about "SCRIPTS".  What I think is
> stupid is that if I do use SCRIPTSNAME I still have to use SCRIPTS.  Also
> as written, bsd.prog.mk doesn't handle this well:
> 
>     .for script in ${SCRIPTS}
>     .if defined(SCRIPTSNAME)
>     SCRIPTSNAME_${script:T}?= ${SCRIPTSNAME}
>     .else
>     SCRIPTSNAME_${script:T}?= ${script:T:R}
>     .endif
> 
> So what we have is SCRIPTS is a list, but SCRIPTSNAME name isn't.
> So what happens with
>     ...
>     SCRIPTS=foo.sh bar.sh
>     SCRIPTSNAME=baz
>     .include <bsd.prog.mk>
> 
> both get installed as baz.  SCRIPTS and SCRIPTSNAME should be treated
> separately.  I'd fix it, but anytime I touch bsd.*.mk you pop up and I
> have a federal case on my hands -- thus I now try hard to never touch
> them.

The SCRIPTSNAME stuff seems to be intentional.  I use some hokey magic
like so to deal with compiled python scripts:

# Special rules to handle installing Python scripts
.if defined(PYSRCS) && !empty(PYSRCS)
PYOBJS=         ${PYSRCS:S/$/c/}
SCRIPTS+=       ${PYOBJS}
CLEANFILES+=    ${PYOBJS}
.ifdef PYDIR
SCRIPTSDIR=     ${PYDIR}
.endif
SCRIPTSMODE=    444
.for script in ${PYOBJS}
SCRIPTSNAME_${script:T}?=       ${script}
.endfor
.endif

Then I just have 'PYSRCS=foo.py bar.py' and the compiled versions get
installed as foo.pyc and bar.pyc.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030306152521.jhb>