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 8150423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:03:45+00:00 2026-06-06T15:03:45+00:00

I have a makefile for compiling Arduino programs . I need to add some

  • 0

I have a makefile for compiling Arduino programs.

I need to add some text at the beginning of some files based on some logic. I am using echo command for that.

ECHO    = echo

and later in the file, I have lot of places like

$(OBJDIR)/%.cpp: %.pde
    $(ECHO) '#if ARDUINO >= 100\n    #include "Arduino.h"\n#else\n    #include "WProgram.h"\n#endif' > $@

which works fine.

Recently, some users complained that echo command doesn’t work properly in some linux distros and I had to add the ‘-e’ option to the echo command.

So I changed the first line where I declare the command to

ECHO    = echo -e

This is not working, because makefile considers -e as part of the text and not as part of the option.

Edit:

I am not getting any error, but the text -e is also appended to the file that I am creating.

Is there a way to declare the -e as an option and not as part of the text?

  • 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-06-06T15:03:46+00:00Added an answer on June 6, 2026 at 3:03 pm

    Most likely you’re seeing behavior differences because echo is a shell built-in command in some versions of some shells. Then that’s being compounded because make only sometimes uses the shell to invoke commands — it will prefer to invoke commands directly if possible. So, sometimes, on some systems, you are not invoking the echo command that you think you are.

    You would probably have better luck by setting

    ECHO = /bin/echo -e
    

    which will explicitly invoke the external echo command, even if the shell has a built-in version. That way you should get consistent results.

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

Sidebar

Related Questions

I have a makefile project that builds and links a DLL, using the command-line
I would like to have a makefile copy files from another directory and change
I have a makefile that depending on some properties sets vpath and generates a
I am trying to write a makefile for compiling a program with source files
I have a Makefile.am for compiling Ocaml source code with ocamlbuild . However, even
We have few projects, which are compiling my makefile. These make file working fine
When compiling a project via a makefile using the Emacs compile command, when gdb
I have this C++ project which compiles using a Makefile, and sometimes when (
I have a Makefile building many C files with long long command lines and
In my makefile I have the following target, which compiles text/HTML resources into unsigned

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.