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

  • Home
  • SEARCH
  • 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 8581997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:11:02+00:00 2026-06-11T21:11:02+00:00

I have the following: a .c code, a .h code plus a .o file

  • 0

I have the following: a .c code, a .h code plus a .o file and a -lib… library. When I compile the c code with gcc I do:

gcc code.c -o code file.o -library

How to create a makefile?

I currently have with autoconf and automake?

I currently have:

Makefile

all: 
  gcc code.c -o code file.o -library

clean:

 rm -f code

When I compile make I get:

make: Nothing to be done for `all'.

Need some help. Thx

  • 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-11T21:11:03+00:00Added an answer on June 11, 2026 at 9:11 pm

    I’m sorry I have to give this answer, but have you tried https://www.google.com/search?q=makefile+tutorial?

    Pick one, and learn how to create a Makefile. You don’t need the autotools.

    It took me 5 minutes to come up with this, by reading Makefile Tutorial:

    CC=gcc
    CFLAGS=-Wall
    CLIBS=-lX11
    OUT=code
    OBJS=code.o file.o
    
    
    $(OUT): code.o file.o
        $(CC) $(CFLAGS) $(CLIBS) -o $(OUT) $(OBJS)
    code.o: code.c
        $(CC) $(CFLAGS) -c code.c -o code.o
    file.o: file.c
        $(CC) $(CFLAGS) -c file.c -o file.o
    
    .PHONY: clean
    
    clean:
        rm -rf *.o $(OUT)
    

    If on the computer the -library doesn t exist I want to install it automatically.

    This is specific to the distribution used and you need root access on the machine. Doing it like this is not how it’s done. Instead, you should create a package specific for your distribution where you specify the dependencies.

    For instance, for Ubuntu (since it’s the most used distribution), you’d create a .deb file: http://wiki.debian.org/IntroDebianPackaging

    This, however, has nothing to do with your initial question.

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

Sidebar

Related Questions

I have the following code in my layout file: <% @families = ProductFamily.find(:all, :include
I have a .svg file that has the following code: <svg version=1.1 x=0 y=0
I have the following code to create two buttons (one on the left one
gcc does not like the following code: inline const plus(unsigned x,unsigned y) __attribute__((pure)); inline
In my App.xaml file, I have the following code to allow double-decker column headers
I have the following C# code to produce a small PHP file. The reason
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code for loading image from url in xml parsing endElement method

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.