[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to preserve $-containing terms in an expanded variable (with cal
From: |
Dimitry Golubovsky |
Subject: |
Re: How to preserve $-containing terms in an expanded variable (with call)? |
Date: |
Tue, 14 Mar 2006 07:24:57 -0500 |
Thanks for the replies. Indeed, I have already found alternative
solution and changed the logics of my Makefile, so this is no longer
needed.
But here are more details (from the past).
Of course, I meant $(1), not $(U): this was just a typo. Secondly, the
call to my variable was part of invocation of a recursive make, like
this (here is the full target, tabs not preserved):
ghc_prep:
cd fudgets/Graphics/UI/Fudgets; ln -sf _ghc CompDep
cd fudgets/Graphics/UI/Fudgets; ln -sf _ghc_dialogue Dialogue
cd xlib; make ghc-all ; mv ghc-xlib.a libGhcXlib.a
make cabalfile COMP=Ghc \
EXTRAPKG= \
EXTRAEXT= \
COMPOPTIONS="-fglasgow-exts"\
EXCLMOD="grep -v GhcWord | \
grep -v P_IOC | \
grep -v SPLib | \
grep -v extract | \
grep -v multiclass | \
grep -v Barlayouter | \
grep -v Exceptions | \
grep -v Splogue | \
grep -v Fudlogue | \
grep -v DFudlogue | \
grep -v TextCursor | \
grep -v OldStateMonads | \
grep -v OldEdit | \
grep -v OldTerminalF | \
grep -v Edit2 | \
grep -v Contrib | \
grep -v DrawCompiledGraphics[23]" \
SETUP=Setup_ghc.hs.in \
EXTRALIBDIRS="\/usr\/X11\/lib" \
EXTRALIBS="GhcXlib X11 Xext"
and the call to my variable was to be inserted among those grep -v's, like this:
........
grep -v OldEdit | \
$(call myvar,MenuBar) | \
grep -v OldTerminalF | \
grep -v Edit2 | \
.........
myvar = awk '$$0 != $(1) { .... }'
Here is the target of the recursive make (to see how EXCLMOD is used).
cabalfile:
cat $(SETUP) > Setup.hs
cat Fudgets.cabal.in | \
sed 's/@COMP@/$(COMP)/g' | \
sed 's/@EXTRAPKG@/$(EXTRAPKG)/g' | \
sed 's/@EXTRAEXT@/$(EXTRAEXT)/g' | \
sed 's/@COMPOPTIONS@/$(COMPOPTIONS)/g' | \
sed 's/@EXTRALIBDIRS@/$(EXTRALIBDIRS)/g' | \
sed 's/@EXTRALIBS@/$(EXTRALIBS)/g' \
> Fudgets.cabal
echo "Include-dirs:" >> Fudgets.cabal
find include -type d | sed 's/^/ /g' >> Fudgets.cabal
echo "C-sources:" >> Fudgets.cabal
ls -1 cbits/*.c | sed 's/^/ /g' >> Fudgets.cabal
echo "Other-modules:" >> Fudgets.cabal
(cd fudgets ; ls -1 Graphics/UI/Fudgets/[A-Z]*/*.hs) | sed
's/^/ /g' | \
sed 's/\//./g' | sed 's/\.hs$$//g' | $(EXCLMOD) >> Fudgets.cabal
(cd compat ; ls -1 Graphics/UI/Fudgets/[A-Z]*/*.hs) | sed 's/^/ /g' | \
sed 's/\//./g' | sed 's/\.hs$$//g' | $(EXCLMOD) >> Fudgets.cabal
echo "Exposed-modules:" >> Fudgets.cabal
(cd fudgets ; ls -1 Graphics/UI/Fudgets/*.hs) | sed 's/^/ /g' | \
sed 's/\//./g' | sed 's/\.hs$$//g' | $(EXCLMOD) >> Fudgets.cabal
I am writing this out of my memory because the Makefile has already
been overwritten with new logics. Maybe the part of the problem was
that it was the shell running recursive make that expanded the $$0,
but I tried to insert backslashes to escape dollar signs; this did not
help. Anyway, if it can be found where I was mistaken, this might help
someone else trying to do similar things.
--
Dimitry Golubovsky
Anywhere on the Web