[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Skipped secondary expansions inside make rules
From: |
Dmitry N. Mikushin |
Subject: |
Skipped secondary expansions inside make rules |
Date: |
Fri, 4 Mar 2011 18:44:05 +0300 |
Hi,
Consider the following example rule:
%.so: LIBNAME = $(shell echo $(notdir $(basename $@)) | sed s/lib// | \
tr '[a-z]' '[A-Z]' | tr '/' '_')
%.so: DEPLIBS = $$($(LIBNAME)_DEPLIBS)
%.so: dirs
@echo Linking shared library $(LIBNAME) ...
$(CPPCOMP) $(CPARAMS) -Wl,--no-undefined -shared -o $@ -L$(OUTDIR) \
-Wl,--gc-sections -Wl,--whole-archive -Wl,-static \
$(addprefix -l, $(STATIC_LIBS)) \
-Wl,--no-whole-archive -Wl,-call_shared $(DEPLIBS)
If it is applied to bin/libfoo.so, LIBNAME becomes FOO, DEPLIBS
becomes FOO_DEPLIBS, and final command works incorrectly because $$
expansions were not actually performed. Why are expansions skipped and
what can I do to get them working in this case?
Thanks,
- D.
- Skipped secondary expansions inside make rules,
Dmitry N. Mikushin <=