Ik probeer een makefile te maken als volgt:
PROGRAMS = blink
all: $(PROGRAMS)
$(PROGRAMS): % : %.o
ld -o $@ $<
clean:
rm -f *.o
Dit werkt goed.

De filenaam "blink" staat boven in het programma.
Om de make file uit te voeren geef ik in
make
Maar nu wil ik de filenaam via de
command line invoeren.
make blink
PROGRAMS =
ifneq ($(MAKECMDGOALS), clean) <------------invalid syntax in condition
ifneq PROGRAMS = $(MAKECMDGOALS)
PROGRAMS = $(MAKECMDGOALS)
endif
endif
all: $(PROGRAMS)
$(PROGRAMS): % : %.o
ld -o $@ $<
clean:
rm -f *.o
Foutmelding: makefile:4: *** invalid syntax in conditional. Stop.

(p.s. dit voorbeeld komt uit: Raspberry Pi Assembly Language Raspbian Beginners. bladzijde 87)