Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4344022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:50:13+00:00 2026-05-21T11:50:13+00:00

I am trying to use ifeq in my rule pattern and I have problems

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:50:13+00:00Added an answer on May 21, 2026 at 11:50 am

    The lines containing ifeq..., else, and endif should not start with a tab. If they do they are treated as part of the recipe and sent to the shell; this leads to the syntax error you get from /bin/sh; see the make manual for an example.

    I’m not exactly sure why you get an error when you don’t use indentation. Perhaps you can’t define a variable in a recipe like this?

    Edit: I see you’ve found the answer. So, no indentation, and a space between ifeq and the parenthesis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to use LINQ to SQL I encountered several problems. I have table
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
i'm trying use webview to load a image from sdcard i use this path
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
Trying to use the getDependentRowset in a ZF application. I have the following relationship
Trying to use a lib but getting this error... npm ERR! JSON.parse Failed to
Trying to use this following script to load a page so that I can
Im trying to use the DotNetOpenAuth library for openid authentication. I have used the
trying to use putExtra and getExtra with Bundle to share variables across activities: this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.