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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:21:52+00:00 2026-06-18T16:21:52+00:00

If I create an implicit rule with a prerequisite (but no recipe), then the

  • 0

If I create an implicit rule with a prerequisite (but no recipe), then the dependency does not seem to be honored. If, on the other hand, I define the prerequisite in the block where I define the recipe, or if I specify a dependency of a particular instance of the target, it does seem to work. I have the following Makefile (GNU make 3.81)

all:  foo.a foo.b bar.b bar.c

dep1:
    @echo "running $@"

%.a: dep1

%.a:
    @echo "running $@ (depends on: $^)"

bar.b: dep1

%.b: dep1
    @echo "running $@ (depends on: $^)"

bar.c: dep1

bar.c:
    @echo "running $@ (depends on: $^)"

If I run make, I get:

~/tmp/tmp5> make
running foo.a (depends on: )
running dep1
running foo.b (depends on: dep1)
running bar.b (depends on: dep1)
running bar.c (depends on: dep1)

It seems that even though I have %.a depend on dep1, that foo.a can be built without dep1 being built. Is this a bug in make, or is there a reason for this behavior?

Thanks,

John

  • 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-18T16:21:53+00:00Added an answer on June 18, 2026 at 4:21 pm

    Pattern rules with the same target don’t get combined into a single rule like non-pattern rules do. When you have two non-pattern rules for the same target, they get combined into a single rule with all the dependencies of the two rules and the actions from the rule that has actions (and it is an error for both rules to have actions). With pattern rules, that does not happen — they are treated as two completely independent rules, either of which can be used to update the target.

    The reason for that is pretty obvious when you think of the builtin pattern rules — there are multiple rules for %.o which can compile a source file in a variety of languages. If they all got combined into a single rule, it simply wouldn’t work.

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

Sidebar

Related Questions

When I perform a select/Insert query, does SQL Server automatically create an implicit transaction
I am trying to create an implicit conversion from any type (say, Int) to
Do you need to explicitly create an index, or is it implicit when defining
I'd like to create an IList<Child> that maintains its Child objects in a default/implicit
CREATE TABLE `tbl_atn` ( `atn_id` int(15) NOT NULL AUTO_INCREMENT, `eng_id` int(15) DEFAULT NULL, `visit`
create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't
CREATE TABLE profile_category ( id mediumint UNSIGNED NOT NULL AUTO_INCREMENT, pc_name char(255) NOT NULL,
I am not able to create a Future as explained here . It says
Does Autofac support implicit lifetime scopes for the use of a factory? For example,
I would like to create a macro as such: <macrodef name=testing> <element name=test implicit=yes/>

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.