.. vim: noexpandtab fileencoding=utf-8 nomodified wrap textwidth=200 foldmethod=marker foldmarker={{{,}}} foldcolumn=4 ruler showcmd lcs=tab\:|- list :date: 2023.04.15 11:21:56 :tags: hint,make :authors: Gilhad :summary: make: different hints :title: make: different hints :nice_title: |logo| make: different hints |logo| %HEADER% No builtin rules -------------------------------------------------------------------------------- .. code:: MAKEFLAGS += --no-builtin-rules --output-sync Target A depends on B anytime, on C if it exists -------------------------------------------------------------------------------- .. code:: %.A: %.B %.C @echo %.A: %.B %.C touch $@ %.A: %.B @echo %.A: %.B touch $@ Rules use the same recipes -------------------------------------------------------------------------------- .. code:: Recipe=command;command;command_using_variables %.A: %.B @$(Recipe) .. code:: Recipe = echo "First argument: $(1)"; \ echo "Second argument: $(2)"; \ echo "Third argument: $(3)" %.A: %.B @$(call Recipe,arg1,arg2,arg3) %.C: %.D @$(call Recipe,arg4,arg5,arg6)