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

The Archive Base Latest Questions

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

Where do we put the all in a Makefiles? I had a similar question

  • 0

Where do we put the all in a Makefiles?

I had a similar question found earlier, but I needed a little bit more details. I also looked at the GNU make manual, but got lost in the mountain of documentation. I tried the googles, but didn’t find a good example. So, I did what was my last resort and tried to figure it out by hacking at a Makefile myself. I have:

CC=gcc
CFLAGS=-Wall -g

clean: 
rm -f all: ex1

This didn’t compile my ex1 in C. Also, if I wanted to add more to this make file. Like ex1, ex2, to exercise whatever. Would I just put the all at the top and repeat the

rm - f whatever

line below clean?

Appreciate your help and assistance. Patience appreciated too.

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

    all is actually nothing special, just a target name commonly used. To make it work best, it should be the first target in the file. This makes it the default target, and gmake works the same as gmake all.

    Normally, the all target has dependencies, which are the things which need to be built. E.g.

    all: myexe
    

    rm is related to the clean target (which is also nothing special, just a name commonly used). You define it this way:

    clean:
        rm -f myexe
    

    This makes it delete myexe when gmake clean is run. If you makefile builds other files, they should also be listed there.

    There’s a lot more to know about makefiles. Normally you would use variables and template rules, which help you avoid repeating yourself. But this is far more than a simple answer can describe.

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

Sidebar

Related Questions

I put all my code in NS, similar to how jQuery is structured. I
I know that I should put all the html elements in body tag, but
How can I fetch more than 1000 record from data store and put all
Should I write a script to put all of those data in? But wouldn't
I want to put all my resources into a ClientBundle for easy management. So
I want to put all the requirements of a repoze Zope2 install in a
So I need to put all the names in a file into column 1
By someone's advice I've put all my PHP files in a separate folder (inc)
Up until now I just put all my jQuery goodness inside the $(document).ready() function,
In Android it causes HUGE issues if you don't put all of your UI

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.