1 ##===- docs/mk/common.rules.mk -----------------------------*- Makefile -*-===##
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 ##===----------------------------------------------------------------------===##
10 # Emit an error for any missing variables which are required to be defined
11 # before including this makefile-module.
13 _DOCS.vars.missing := $(foreach v,$(DOCS.vars.mandatory),$(if $($v),,$v))
15 ifneq (,$(strip $(_DOCS.vars.missing)))
16 $(call fn.DUMP.errorn,undefined variable,$(_DOCS.vars.missing))
19 ##===----------------------------------------------------------------------===##
21 # Basic target to build directory of output files.
22 # Opaque file lists not visible to target rules need not be added here.
24 $(sort $(dir $(DOCS.mkdir.files))):
25 $(Echo) Creating directory $(@:$(PROJ_OBJ_ROOT)/%=%)
28 ##===----------------------------------------------------------------------===##
30 # Print help defined by variables added to the help list.
34 $(foreach h,$(HELP.sections),$(info $())$(info $($h)))
37 ##===----------------------------------------------------------------------===##
39 printvars:: $(DOCS.vars.mandatory:%=%.print.var)
40 printvars:: $(DOCS.vars.print:%=%.print.var)
44 @echo '$($*)' | awk -v name='$*' '{ printf("llvm[$(MAKELEVEL)]: %-13s: %s\n",name,$$0) }'
46 ##===----------------------------------------------------------------------===##
49 vars: $(sort $(foreach n,$(filter-out \
50 .VARIABLES $(HELP.sections) HELP.%,$(.VARIABLES)),$n.print2.var))