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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:23:48+00:00 2026-06-18T01:23:48+00:00

If I type just $ make it will invoke the make command with the

  • 0

If I type just

$ make

it will invoke the make command with the default target (typically the first target specified in the Makefile, but the rules are a bit more complicated than that).

Is there a way to specify the default target on the command line without knowing what it is, other than by simply omitting the target name?

What I’d like to be able to do is combine these two commands:

$ make clean
$ make

into a single invocation of make. If I happen to know that the default target is all, I can type:

$ make clean all

but that doesn’t work if I don’t know what the default target is.

Ideally, I’d like some syntax that refers to the default target (the GNU make manual calls it the “default goal”). This:

 $ make clean .DEFAULT_GOAL

shows the general idea, but it doesn’t work.

Second best would be a simple and reliable way to determine, from the command line, what the default target is:

$ make clean $(get-default-target)

A GNU-specific solution would be ok.

I suspect, from a quick look into the manual, that there’s no good way to do this.

  • 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-18T01:23:49+00:00Added an answer on June 18, 2026 at 1:23 am

    For a shot at the second-best solution, you can parse the default goal from the output of make -pq:

    make -pq  | sed -ne 's/^.DEFAULT_GOAL := //p'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very new to javascript and html-type stuff. I wanted to just make a quick
I'm trying to make a bit of code like this work: Type pageType =
I've got the following block definition, which outputs the block of my/type just fine:
There's a nice plugin for Frog CMS that lets you just type in yourpicture.120x120.jpg
In C# adding event handler methods is very easy. You just type object.event +=
I've used CCK to create a 'Travel Offer' content-type which basically just lists the
It's just a service locater type of pattern I am trying to implement, where
can you just tell me for which type of requirement we should choose framework
3I was just wondering if this type of query is even possible. If so,
Which data type in Java can hold just the date and doesn't require a

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.