[NTLUG:Discuss] gnu make
Michael Sandfort
sandfort at post.cis.smu.edu
Mon Feb 21 09:38:53 CST 2000
Sorry for the off-topic post, but I'm hoping someone can give me a quick
and easy fix to this. I've got some source code that I need to compile
with an included Makefile.
Short version of the problem:
Does anyone know a quick-and-dirty workaround to the fact that gnu make
does not support the $$@ macro?
Long version:
The Makefile is designed to compile against a variety of setups (i.e., do
you have software packages Matlab, Gauss, etc.).
Problem 1) When I try to compile for my setup, I get the following error
from gnu make:
Makefile:170: *** target pattern contains no `%'. Stop.
Getting rid of the offending line (it pertains to another system setup)
gets rid of this error, but I would like to know why it is happening.
Line 170 reads:
$(MATLAB_MEX): $${@:.mexsol=.o} $(MATLAB_DIR)/mexversion.o $(MATLAB_OTHER) $(OPENLIBS_Matlab) $(CLOSEDLIBS)
$(LD) $(MLDFLAGS) -o $@ ${@:.mexsol=.o} $(MATLAB_DIR)/mexversion.o \
$(MATLAB_OTHER) $(OPENLIBS_Matlab) $(CLOSEDLIBS)
Problem 2) Even when the offending line is removed, I get the error:
make: *** No rule to make target `$@.o', needed by `Unix/expect1'. Stop.
The offending line appears to be
$(UNIXOTHER): $$@.o $(UNIXDEP) $(OPENLIBS) $(CLOSEDLIBS)
$(CC) -o $@ $@.o $(UNIXOBJ) $(OPENLIBS) $(CLOSEDLIBS) -lm
$(CC) -g -o $@_db $@_db.o $(UNIXOBJ_DB) $(OPENLIBS_DB) $(CLOSEDLIBS) -lm
Having read the make manual, I know that $$@ is not supported by gnu make
(unlike it is on SysV and BSD). Is there any way to get around this,
short of listing every single source/object file?
Thanks much,
Mike
Michael T. Sandfort Phone: 214-768-3856
Department of Economics Fax: 214-768-1821
Southern Methodist University
More information about the Discuss
mailing list