I am trying to use ifeq in my rule pattern and I have problems with it. This is the rule I am having trouble with:
$(OBJS): $(OBJDIR)/%.o : ../%.c @mkdir -p $(dir $@) ifeq(mcc.exe,$(CC)) o_file:=$(shell echo $@ | sed -e 's/\/cygdrive\///' | sed -e 's/\([a-zA-Z]\)/\1:/') $(CC) $(CFLAGS) $< -o $(o_file) else $(CC) $(CFLAGS) $< -o $@ endif
When I run this, I get:
"/bin/sh: -c: line 0: syntax error near unexpected token `mcc.exe,mcc.exe' /bin/sh: -c: line 0: `ifeq(mcc.exe,mcc.exe)'"
But, when I don't use indention, then I get : "Makefile:77: * missing separator. Stop."
I am using GNU make 3.81 on Cygwin. Whole issue with the ifeq comes from the fact that I have same Makefile for two toolchains and one of them (mcc.exe) can not cope with the /cygdrive/c/…/something paths, but instead there should be c:/…/something path. If you know any other way to work around this, I would be also very grateful!
Thank you in advance!