my Makefile.am creates the executable main: "symplerTest" i want to link the files "geometry/source/*.o". Currently im linking it like this:
symplerTest_LDFLAGS = \
...
geometry/source/*.o
That works. But now in a next step, i want to link only if the files *.o exist. I tried this one:
if ("$(wildcard $(geometry/source/*.o))","")
symplerTest_LDFLAGS += geometry/source/*.o
endif
but get the following error message:
srcUnittest/Makefile.am:81: error: endif without if
srcUnittest/Makefile.am:79: warning: wildcard $(geometry/source/*.o: non-POSIX variable name
srcUnittest/Makefile.am:79: (probably a GNU make extension)
The problem seems to be at ("$(wildcard $(geometry/source/*.o))","")
Thank you!
You are confusing the Automake directive
if
with the Make directiveifeq
,The Automake manual at 20 Conditionals emphasises:
if
is not a Make directive at all.ifeq
is a Make directive for which valid arguments may be of the form(arg1, arg2)
.means, to Make, if
arg1
is equal toarg2
.Arguments of the form
(arg1, arg2)
are invalid for the Automake directiveif
. Valid arguments for the Automakeif
directive are Automake condition-names, e.g.means, to Automake, if the condition named by
DEBUG
is true - whereDEBUG
is a condition name that you have previously created by means of theAM_CONDITIONAL
macro.Refer to the linked documentation.