Explaining makefile

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-05-01T04:59:51Z Indexed on 2010/05/01 5:07 UTC
Read the original article Hit count: 156

Filed under:
|
xpi_built := $(build_dir)/$(install_rdf) \
             $(build_dir)/$(chrome_manifest) \
             $(chrome_jar_file) \
             $(default_prefs)

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

$(xpi_file): $(build_dir) $(xpi_built)
 @echo "Creating XPI file."
 cd $(build_dir); $(ZIP) ../$(xpi_file) $(xpi_built_no_dir)
 @echo "Creating XPI file. Done!"

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

$(build_dir):
 @if [ ! -x $(build_dir) ]; \
  then \
    mkdir $(build_dir); \
  fi

can anyone explain me this makefile part? particularly interested in

  • $(build_dir)/%: % as well as $< and $@ directives
  • two labels $(build_dir) exists, I guess both are executed, but in which order?

© Stack Overflow or respective owner

Related posts about makefile

Related posts about syntax