I am trying to use ifeq in my rule template and I am having problems with it. This is the rule I'm having problems 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 do not use indentation, I get: "Makefile: 77: * missing separator. Stop."
I am using GNU make 3.81 on Cygwin. The whole problem with ifeq comes from the fact that I have the same Makefile for the two tool chains, and one of them (mcc.exe) cannot handle the path /cygdrive/c/.../something, but should instead be c: /.../ something way. If you know any other way around this, I would also be very grateful!
Thank you in advance!
Nikola
source share