michael@0: # -*- makefile -*- michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: ################################################## michael@0: ## Gather a list of tests, generate timestamp deps michael@0: ################################################## michael@0: TS=.ts michael@0: ifneq (,$(findstring check,$(MAKECMDGOALS))) michael@0: allsrc = $(wildcard $(srcdir)/*) michael@0: tests2run = $(notdir $(filter %.tpl,$(allsrc))) michael@0: check_targets += $(addprefix $(TS)/,$(tests2run)) michael@0: endif michael@0: michael@0: check:: $(TS) $(check_targets) michael@0: michael@0: ############################################# michael@0: # Only invoke tests when sources have changed michael@0: ############################################# michael@0: $(TS)/%: $(srcdir)/% michael@0: $(PERL) $(srcdir)/runtest $< michael@0: @touch $@ michael@0: michael@0: ##################################################### michael@0: ## Extra dep needed to synchronize parallel execution michael@0: ##################################################### michael@0: $(TS): $(TS)/.done michael@0: $(TS)/.done: michael@0: $(MKDIR) -p $(dir $@) michael@0: touch $@ michael@0: michael@0: GARBAGE_DIRS += $(TS) michael@0: michael@0: # EOF