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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:23:11+00:00 2026-05-14T15:23:11+00:00

How can I distinguish in makefile, which targets and how( when ) they are

  • 0

How can I distinguish in makefile, which targets and how(when) they are called internally? I have a makefile with number of targets which are actually variables.

UPD: here is an example

build_dir := $(bin_dir)/build

xpi_built := $(build_dir)/$(install_rdf) \
             $(build_dir)/$(chrome_manifest) \
             $(chrome_jar_file) \
             $(default_prefs)/*

xpi_built_no_dir := $(subst $(build_dir)/,,$(xpi_built))

.PHONY: install
install: $(build_dir) $(xpi_built)
    @echo "Installing in profile folder: $(profile_location)"
    @cp -Rf $(build_dir)/* $(profile_location)
    @echo "Installing in profile folder. Done!"
    @echo

$(xpi_file): $(build_dir) $(xpi_built)
    @echo "Creating XPI file."
    @cd $(build_dir); $(ZIP) -r ../$(xpi_file) $(xpi_built_no_dir)
    @echo "Creating XPI file. Done!"
    @cp update.rdf $(bin_dir)/
    @cp -u *.xhtml $(bin_dir)/
    @cp -Rf $(default_prefs) $(build_dir)/; \

$(build_dir)/%: %
    cp -f $< $@

$(build_dir):

    @if [ ! -x $(build_dir) ]; \
  then \
    mkdir $(build_dir); \
  fi
  • 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-14T15:23:12+00:00Added an answer on May 14, 2026 at 3:23 pm

    If you specify a target on the command line, as in make clean Make will attempt to build that target. If you don’t (that is, if you just run make), Make will attempt to build the default target; the default target is the first target in the makefile (in your case install) unless you set it to something else with the .DEFAULT_GOAL variable.

    When Make tries to build a target, it first builds that target’s prerequisites, if necessary. (When is it necessary? When a target is a file or directory that does not exist real (unless it’s .PHONY, but that’s an advanced topic), or when one of it’s prerequisites is newer than the target (unless it’s “order-only”, but that’s an advanced topic)). So if Make is trying to build your all, it will first try to build $(build_dir) and $(xpi_built), which have been defined elsewhere in the makefile.

    If you’re trying to figure out what Make will do and when, there are tricks you can use. For example, you can run make -n, and Make would tell you what it would do, instead of doing it. Or you can put a command like @echo now making $@ in a rule, to tell you what it’s doing. Or for even more information:

    some_target: preq another_preq and_another
        @echo Making $@. The prerequisites are $^. Of those, $? are newer than $@.
        other_commands...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I distinguish a variable as a compiler-constructed string? For example, while the
Can I distinguish signal, between delivered directly to a process and delivered via debugger.
There seems to be a bug in the Java varargs implementation. Java can't distinguish
I'm trying to find a CSS selector that can help me distinguish between the
I'm looking at things that can distinguish a blog from a normal website. These
In Windows you can distinguish the 'move' drag operation from a 'copy' drag operation
I wonder if someone can distinguish precisely between these? For my understanding, Core Graphics
I have a template class that can (and sometimes has to) take a const
I have an app that manages a list of third-party servers and can poll
I have a supervisor which starts simple_one_for_one children. Each child is in fact 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.