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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:42:57+00:00 2026-05-13T10:42:57+00:00

I have seen commands like this all over Makefiles, which I don’t quite understand:

  • 0

I have seen commands like this all over Makefiles, which I don’t quite understand:

vpath.o: make.h config.h getopt.h gettext.h dep.h

and

.SUFFIXES:
.SUFFIXES:  .f  .o
#
# %------------------%
# | Default command. |
# %------------------%
#
.DEFAULT:
    @$(ECHO) "Unknown target $@, try:  make help"
#
# %-------------------------------------------%
# |  Command to build .o files from .f files. |
# %-------------------------------------------%
#
.f.o:
    @$(ECHO) Making $@ from $<
    @$(FC) -c $(FFLAGS) $<

What does the *.o and *.suffixes mean?

Note: The two commands are from different parts of the script.

  • 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-13T10:42:57+00:00Added an answer on May 13, 2026 at 10:42 am

    The first line in your question is just a standard Makefile rule.

    vpath.o: make.h config.h getopt.h gettext.h dep.h
    

    A .o file is an object file; it’s an intermediate product in between your source files and the final compiled binary. It contains compiled code, but it hasn’t been linked together into a complete library or binary yet. This rule just says that vpath.o depends on make.h, config.h, etc., and each time those are changed, it should be re-compiled. The commands necessary to build vpath.o should follow on subsequent lines, indented with a tab character. (Apologies if I’m repeating stuff you already know; I wasn’t sure what part of that first line you were confused about).

    The .SUFFIXES doesn’t refer to an actual file suffix; it’s just a special kind of rule in a makefile which is used for configure “suffix rules”.

    Suffix rules are rules of the form .a.b, such as you see with your .f.o rule. They are a way of telling make that any time you see, say, a .f file (the source file), you can make a .o file (the target file) from it by following that rule, where $< indicates the source file and $@ represents the target file.

    the .SUFFIXES “target” is a way to define which suffixes you can use in your suffix rules. When used with no prerequisites, it clears the built in list of suffixes; when used with prerequisites, it adds those to its list of known suffixes that may be used in suffix rules.

    In GNU make, you can use the more powerful and more clear % to form pattern rules, like:

    %.o: %.c
        gcc -c -o $@ $<
    

    which is the equivalent of the suffix rule:

    .c.o:
        gcc -c -o $@ $<
    

    See the GNU Make documentation for more information (but which also mentions GNU extensions), or the Single Unix Specification/POSIX for the common, portable syntax.

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

Sidebar

Related Questions

I have seen many posting this issue in SO. I have gone through those
I have seen in a few libraries, Spray for example, dual package specifications like
I have seen this talked about but never answered. Maybe it has and I'm
I have seen this question and its answers and they clear up some of
My way of writing stuff looks something like this - I have a colorcolumn
I have seen references to similar issues, but not this exact one. I have
This is going to be very simple I know. I have seen so many
I have an insert query for MySQL that looks like this: INSERT INTO table
How many times have you seen someone trying to Log the command I run
Have seen some similar questions: What is the difference between a JavaBean and 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.