config/tests/makefiles/autodeps/testor.tmpl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/tests/makefiles/autodeps/testor.tmpl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +# -*- makefile -*-
     1.5 +#
     1.6 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 +# You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +#
    1.10 +
    1.11 +###########################################################################
    1.12 +## Intent: Standalone unit tests for makefile rules and target logic
    1.13 +###########################################################################
    1.14 +
    1.15 +deps =$(NULL)
    1.16 +tgts =$(NULL)
    1.17 +
    1.18 +ifdef VERBOSE
    1.19 +  tgts += show
    1.20 +endif
    1.21 +
    1.22 +# Define macros
    1.23 +include $(topsrcdir)/config/makefiles/makeutils.mk
    1.24 +include $(topsrcdir)/config/makefiles/autotargets.mk
    1.25 +
    1.26 +##########################
    1.27 +## Verify threadsafe mkdir
    1.28 +##########################
    1.29 +ifdef deps_mkdir_bycall
    1.30 +  deps += $(call mkdir_deps,deps_mkdir_bycall)
    1.31 +  tgts += check_mkdir
    1.32 +endif
    1.33 +ifdef deps_mkdir_bydep
    1.34 +  deps += $(foreach dir,$(deps_mkdir_bydep),$(dir)/.mkdir.done)
    1.35 +  tgts += check_mkdir
    1.36 +endif
    1.37 +ifdef deps_mkdir_bygen
    1.38 +  GENERATED_DIRS += $(deps_mkdir_bygen)
    1.39 +  tgts += check_mkdir
    1.40 +endif
    1.41 +
    1.42 +###########################
    1.43 +## Minimal environment load
    1.44 +###########################
    1.45 +MKDIR ?= mkdir -p
    1.46 +TOUCH ?= touch
    1.47 +
    1.48 +INCLUDED_CONFIG_MK = 1
    1.49 +include $(topsrcdir)/config/rules.mk
    1.50 +
    1.51 +##-------------------##
    1.52 +##---]  TARGETS  [---##
    1.53 +##-------------------##
    1.54 +all::
    1.55 +
    1.56 +# Quarks:
    1.57 +#   o Use of 'all' would trigger export target processing
    1.58 +checkup: $(tgts)
    1.59 +
    1.60 +# AUTO_DEPS - verify GENERATED_DIRS
    1.61 +check_mkdir: $(deps) $(AUTO_DEPS)
    1.62 +
    1.63 +show:
    1.64 +	@echo "tgts=[$(tgts)]"
    1.65 +	@echo "deps=[$(deps)]"
    1.66 +	find $(dir $(deps)) -print

mercurial