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
ifwith the Make directiveifeq,The Automake manual at 20 Conditionals emphasises:
ifis not a Make directive at all.ifeqis a Make directive for which valid arguments may be of the form(arg1, arg2).means, to Make, if
arg1is equal toarg2.Arguments of the form
(arg1, arg2)are invalid for the Automake directiveif. Valid arguments for the Automakeifdirective are Automake condition-names, e.g.means, to Automake, if the condition named by
DEBUGis true - whereDEBUGis a condition name that you have previously created by means of theAM_CONDITIONALmacro.Refer to the linked documentation.