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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:21:20+00:00 2026-06-04T06:21:20+00:00

So i have a makefile here that looks something like ALL_FILES=$(shell find . -name

  • 0

So i have a makefile here that looks something like

ALL_FILES=$(shell find . -name '*')

install : $(ALL_FILES)

$(INSTALL_LOCATION)/%.sh : %.sh  ;   /bin/usr/install -D $^ $@

$(INSTALL_LCOATION)/% : %   ;   /usr/bin/install -D $^ $@

$(INSTALL_LOCATION)/dir1/% : dir1/%   ;  /usr/bin/install -D $^ $@

my question here is , the second install there is obviously a superset of the first one,
but i guess the first one is ran first so the second one is ignored.
however, wouldnt the second one also be a full superset of the third one?

so how does make choose which rule to use? does it choose the most speicifc rule?

  • 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-04T06:21:22+00:00Added an answer on June 4, 2026 at 6:21 am

    Depends on the version of make. For example, in GNU make prior to 3.82, it would search the patterns in the order they were declared and simply use the first pattern that matched, regardless of specificity. In 3.82 and later, GNU make uses the most specific rule, regardless of declaration order. Here’s a simple example:

    all: sub/foo.x
    
    %.x:
        @echo "Prefer first match (stem is $*)."
    
    sub/%.x:
        @echo "Prefer most specific match (stem is $*)."
    

    Compare the output with gmake 3.81 and gmake 3.82:

    $ gmake-3.81 
    Prefer first match (stem is sub/foo).
    $ gmake-3.82
    Prefer most specific match (stem is foo).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Makefile that looks something like this: sometarget: command_one # calls fork()
I have a makefile with something like the following targets: install: do a whole
I have a Makefile that looks like this CXX = g++ -O2 -Wall all:
I have a GNU Makefile that looks a bit like this: LIST = item1
I have a Makefile that compiles, but I want to change the name of
I have a find command that I would like to sort such that entries
I have a makefile from Intel in which there is some ?=. Like COMPILER
I have this Makefile that has a variables named MODULES which lists all the
I have a makefile project that builds and links a DLL, using the command-line
I have a makefile that invokes a python script that lives in the same

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.