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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:22:07+00:00 2026-06-05T16:22:07+00:00

Consider following make: all: a b a: echo a exit 1 b: echo b

  • 0

Consider following make:

all: a b

a:
        echo a
        exit 1


b:
        echo b start
        sleep 1
        echo b end

While running it as make -j2 I receive the following output:

echo a
echo b start
a
exit 1
b start
sleep 1
make: *** [a] Error 1
make: *** Waiting for unfinished jobs....
echo b end
b end

We have quite a big make file and it’s easy to miss error, since there’s no error message at the end of execution.

Is there a way for error message to appear also just in the end of the make execution?

UPDATE:

See my possible solution how to check make exit status from within make.

  • 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-05T16:22:09+00:00Added an answer on June 5, 2026 at 4:22 pm

    If any program called by make returns with an error, the return code of make will not be zero. So after calling make you could just check the return code to see if an error occurred. On bash (and many other shells like zsh) you could do the following:

    # make
    ....
    # echo $?
    

    The echo will print 0 if anything was ok and will print something else if it wasn’t.

    You could also run the check from inside a shell script:

    make
    if [ $? -eq 0 ]; then
        echo "Everything OK"
    else
        echo "Something went wrong!"
    fi
    

    If you need the exact error message the easiest way is to redirect the output from make to some file and grep for the error if execution failed.

    But the way I usually do this is to run make in parallel and re-execute it with -j1 if something went wrong so I will get a clean error message. I guess this could be put into a shell script using the technique above.

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

Sidebar

Related Questions

Consider the following: incl.php <div id='footer'> <?php sleep(10); echo <div class='footer-float'><!-- content --></div>; ?>
Sometimes JavaScript doesn't make sense to me, consider the following code that generates a
Please consider the following code: type TFoo1 = class public procedure DoSomething1; end; TFoo2
How do I force GNU Make variables to evaluate immediately? Consider the following example:
Consider the following situation: There is a master page with a contentPlaceHolder for all
Consider following entry in my mongo collection. { id : _0001, map : {
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider following program: static void Main (string[] args) { int i; uint ui; i
Consider following SWT code example: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet151.java?view=co How can I separate the inline defined class?
Consider following script: SET LANGUAGE 'German' GO SET DATEFIRST 1 GO DECLARE @FullDate DATETIME

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.