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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:10:36+00:00 2026-05-22T12:10:36+00:00

This is in C, am running UNIX through Putty and want to create a

  • 0

This is in C, am running UNIX through Putty and want to create a Makefile.

So I have a program that is in only one file “recommender.c” and i need to make a makefile that creates an executable file called recommender using the all function. The part i don’t know how to do is that i compile recommender.c using the line gcc recommender.c -std=gnu99
I don’t know how to make sure it does the -std=gun99 part too. please help? 🙂

  • 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-22T12:10:37+00:00Added an answer on May 22, 2026 at 12:10 pm
    CFLAGS=-std=gnu99 -Wall -Wextra -O3
    
    all: recommender
    
    recommender: recommender.o
    

    Note that the file extension must be .c if it has the extension .cpp it will need the CXXFLAGS instead of CFLAGS

    Some explanation:

    The make file is dependency based as you can see you can set your variables on top of the make file. Then when the make program is invoked it will search for a Makefile in the current directory.

    Since the default action is all it will search for the all rule.
    When it found the all rule it will check which dependencies are needed in this case the recommender rule / file so it starts searching the rules again and it finds out it needs the recommender.o rule / file but it won’t find any, now here is where the magic happens.

    make is smart enough to know that an .o (object) file is made from an .c or .cpp (source) file so now it will start searching for the source file in the current directory. This he does by replacing the .o with an .c if it finds the file it will compile it with the gcc compiler if it where to find an .cpp file it will compile it with the g++ compiler.

    So now we know this we can simply add multiple source files to the project by adding more object file as dependencies.

    Now you don’t really need to create an object file first since you compile from one source file you can also remove the recommender: recommender.o rule and make will try to create the recommender application by compiling recommender.c or .cpp

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

Sidebar

Related Questions

I have this running software that is currently being used by about 400 people.
I tried following this but that doesn't work in Unix. I've been running this
running UNIX through putty, and using vi and gcc. I am attempting to read
Running this program is printing forked! 7 times. Can someone explain how forked! is
When running this XNA application it should display a rotated rectangle that moves from
Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer
Assuming I'm a big Unix rookie: I'm running a curl request through cron every
I have java application which I am running on Unix from the command prompt.
On Windows it is possible to have a service that allows clients running in
I'm running the Java keytool program with -v $HOME/.keystore, which works fine in Unix

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.