Hi Ralf,
sorry for this late answer, but I was snowboarding this weekend and did not
checked my emails til now...
Ralf Wildenhues schrieb:
I think pointing outside the build tree like this is a hack that can
break. Not sure though, but I would not rely on that to work.
I need this little hack because my distribution is not a "standard"
linux distribution, and I dont want to waste the project root
directory (../$top_srcdir) with the autogenerated files, because other
peoples only have to navigate through the project root directory, and
i want to hide the generated files from them.
I only meant the paths pointing _outside_ the source tree (I actually
wrote `build tree', sorry about that). So, this one
${top_srcdir}/win32
is ok, while this one
${top_srcdir}/../chrome
is not ok.
I did understand you the first time ;) Perhaps my explanation
was a little bit confusing. With "project root directory" I meant not
../$top_srcdir but $top_srcdir/../* . So it was a typo by me.
I think in this case I have no other choice to do so.
Ok ive changed my Makefile.am by removing the idl and plugin target
from the all-local target:
And you've written it a bit more cleanly, which made me actually read
the rules now. ;-)
So I found more issues:
*snip*
packplugin:
for i in `ls ${top_srcdir}/idl/*.idl | awk -F '/' '{ print $$3}'`; do \
${xpidlbin}\
-m header\
-I ${GECKO_PATH}/idl\
-I ${top_srcdir}/idl\
-o ${top_srcdir}/include/$${i: 0: `expr length $$i` - 4}
Several comments here:
- First, I would always add a space before the combination
backslash-newline, but that is arguably a stylistic issue.
- The shell construct `${parameter:n1:n2}' is not portable.
You can use something like
echo foobar | sed 's,\(....\).*,\1,'
instead.
- This part
`ls ${top_srcdir}/idl/*.idl | awk -F '/' '{ print $$3}'`
is IMVHO both ugly and incorrect: what if
top_srcdir=../../../../pkg
? I don't know what xpidlbin does, nor where you usually choose your
build tree, but you probably want something like this:
for file in $(top_srcdir)/idl/*.idl; do
fbase=`echo "$$file" | sed 's|^.*/||'`
do_something_with "$$fbase"
Oh good to know. Thanks for these tips.
I wasn't aware about this portability issue.
I've changed it that way:
for file in $(top_srcdir)/idl/*.idl; do \
filename=`echo $$file | sed 's/.*\///g' | sed 's/\..*//g'`; \
${xpidlbin} \
-m header \
-I ${GECKO_PATH}/idl \
-I ${top_srcdir}/idl \
-o ${top_srcdir}/include/$$filename $$file; \
done
*big snip*
.PHONY: clean-local
.PHONY: all-local
.PHONY: dist-hook
These lines (reordered) are unnecessary. Automake takes care of this.
clean-local I need to do some additional cleanings...
And the dist-hook target I need because of this hack above.
Oh, I did not mean the rules themselves: they are ok. I just meant the
.PHONY lines (for these special targets) are not necessary: Automake
emits those itself already.
Ok, done :)
Cheers,
Ralf
Thanks for your effort and time.
Have a nice sunday.
Steve