Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh

[ Available lists | Index of cvs-all | Month of Mar 2003 | Week of 6 Mar 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
John Baldwin <jhb@FreeBSD.org>
Date
6 Mar 2003 12:25:14
Subject
Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh
Message-ID
XFMail.20030306152521.jhb@FreeBSD.org


[ Hide this part ]
 
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-all" in the body of the message



Elapsed time: 0.303 seconds