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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:13:28+00:00 2026-06-01T02:13:28+00:00

have one time consuming step that flattens a bunch of files. basically i’d like

  • 0

have one time consuming step that flattens a bunch of files.

basically i’d like this to be valid syntax

%.out: %.input1 %.input2
    merge $<1 $<2 $@

doit: project.out
    # project.out merged

i’m far from a makefile expert, but i like to use .SULFFIXS to do that when only have two files, would be great to adapt that to two inputs, or two outputs for future use…

.SULFFIX: .in.out
.in.out:
    dosomething $< $@
doit: project.out

GNU Make 3.81

I’ve found several discussions on how to have a rule with several outputs, but none with several inputs.

  • 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-01T02:13:30+00:00Added an answer on June 1, 2026 at 2:13 am
    %.out: %.input1 %.input2
        merge $<1 $<2 $@
    

    There are no $1 and $2 automatic variables in makefile rules, however, there is $^ which is the list of all prerequisites. As the rule only has two prerequisites it expands to %.input1 %.input2, or, more precisely, to $*.input1 $*.input2. Hence:

    %.out: %.input1 %.input2
        merge $^ $@
    

    Should suffice.

    .SULFFIXES, IMO, is not very useful, since it uses implicit rule definitions which one can’t see and change.

    [update]

    With regards to doit target, to prevent it from executing every time you might like to change the rule commands to:

    doit: project.out
        # project.out merged
        touch $@
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this dilemma many times - and I would like one time and
I have one particular FLA that is crashing every time I try to compile
this time i have a simple question: I have one table, related with himself
I have a time-consuming method with non-predefined number of iterations inside it that I
I have one application where persisting to database is consuming 85% time of the
I have a one-time need to create a file from an iOS mutable array.
i have one problem when i sort the NSMutablearray using date and time wise.
I have a pair of static fields with a complicated one-time initialization. I want
I have a scenario where a user will have access to a one-time-url. When
I have an integer variable ( time ) in one view controller whose value

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.