1# SPDX-License-Identifier: GPL-2.0-or-later 2# Ngie Cooper, June 2010 3 4# Makefiles that are considered critical to execution; if they don't exist 5# all of the Makefiles will be rebuilt by default. 6CRITICAL_MAKEFILE= conformance/interfaces/timer_settime/Makefile 7 8top_srcdir?= . 9 10include include/mk/env.mk 11 12# The default logfile for the tests. 13LOGFILE?= logfile 14# Subdirectories to traverse down. 15SUBDIRS= conformance functional stress 16 17MAKE_ENV= LOGFILE=`if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 18 19BUILD_MAKE_ENV= "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" 20BUILD_MAKE_ENV+= "LDLIBS=$(LDLIBS)" $(MAKE_ENV) 21 22TEST_MAKE_ENV= $(MAKE_ENV) 23 24BUILD_MAKE= env $(BUILD_MAKE_ENV) $(MAKE) 25 26TEST_MAKE= env $(TEST_MAKE_ENV) $(MAKE) -k 27 28all: conformance-all functional-all stress-all tools-all 29 30AUTOGENERATED_FILES = include/mk/config.mk 31 32.PHONY: ac-clean 33ac-clean: clean 34 35.PHONY: clean 36clean: 37 $(RM) -f $(LOGFILE)* 38 $(RM) -f config.log config.status 39 @for dir in $(SUBDIRS) tools; do \ 40 $(MAKE) -C $$dir clean >/dev/null; \ 41 done 42 43.PHONY: distclean 44distclean: clean distclean-makefiles 45 @rm -f $(AUTOGENERATED_FILES) 46 47# Clean out all of the generated Makefiles. 48.PHONY: distclean-makefiles 49distclean-makefiles: 50 @for dir in $(SUBDIRS); do \ 51 $(MAKE) -C $$dir $@; \ 52 done 53 54$(AUTOGENERATED_FILES): $(top_builddir)/config.status 55 $(SHELL) $^ 56 57.PHONY: autotools 58autotools: configure 59 60configure: configure.ac 61 autoconf 62 63.PHONY: generate-makefiles 64generate-makefiles: distclean-makefiles 65 @env top_srcdir=$(top_srcdir) \ 66 $(top_srcdir)/scripts/generate-makefiles.sh 67 68.PHONY: install 69install: bin-install conformance-install functional-install stress-install 70 71.PHONY: test 72test: conformance-test functional-test stress-test 73 74# Test build and execution targets. 75.PHONY: conformance-all conformance-install conformance-test 76conformance-all: $(CRITICAL_MAKEFILE) 77 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 78 @$(BUILD_MAKE) -C conformance -j1 all 79 80conformance-install: 81 @$(MAKE) -C conformance install 82 83conformance-test: 84 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 85 @$(TEST_MAKE) -C conformance test 86 87.PHONY: functional-all functional-install functional-test 88functional-all: $(CRITICAL_MAKEFILE) 89 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 90 @$(BUILD_MAKE) -C functional -j1 all 91 92functional-install: 93 @$(MAKE) -C functional install 94 95functional-test: 96 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 97 @$(TEST_MAKE) -C functional test 98 99.PHONY: stress-all stress-install stress-test 100stress-all: $(CRITICAL_MAKEFILE) 101 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 102 @$(BUILD_MAKE) -C stress -j1 all 103 104stress-install: 105 @$(MAKE) -C stress install 106 107stress-test: 108 @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ 109 @$(TEST_MAKE) -C stress test 110 111# Tools build and install targets. 112.PHONY: bin-install 113bin-install: 114 @$(MAKE) -C bin install 115 116.PHONY: tools-all 117tools-all: 118 @$(MAKE) -C tools all 119 120$(CRITICAL_MAKEFILE): $(top_srcdir)/scripts/generate-makefiles.sh 121 @$(MAKE) generate-makefiles 122 123.PHONY: check 124check: 125 @echo "Checker not yet supported by Open POSIX testsuite" 126