More fixes for testsuite generated files
[dyninst.git] / testsuite / Makefile
1 SUBDIRS = i386-unknown-linux2.4 x86_64-unknown-linux2.4 ppc32_linux ppc64_linux i386-unknown-freebsd7.2 amd64-unknown-freebsd7.2 ppc64_bgq_ion
2 SUBDIR_WINDOWS = i386-unknown-nt4.0
3
4 TO_SPEC = src/specification
5 PROLOG_FILES = $(TO_SPEC)/spec-grouped.pl $(TO_SPEC)/util.pl $(TO_SPEC)/test.pl
6 PYTHON_FILES = $(TO_SPEC)/cmake_mutatees.py $(TO_SPEC)/cmake_mutators.py $(TO_SPEC)/generate.py $(TO_SPEC)/group_boilerplate.py $(TO_SPEC)/parse.py $(TO_SPEC)/test_info_new_gen.py $(TO_SPEC)/tuples.py $(TO_SPEC)/utils.py
7
8 .PHONY: usage gen-all echo $(SUBDIRS) $(SUBDIR_WINDOWS)
9
10 usage:
11         @echo "Use target 'gen-all' to regenerate generated files for all supported"
12         @echo "platforms"
13         @echo "Use target 'gen-clean' to remove generated files for all supported"
14         @echo "platforms"
15         @echo "Use target PLATFORM to make for a specific platform"
16
17 ONE_GENERATED_FILE = cmake-mutatees.txt
18 ALL_GENERATED_FILES = $(foreach dir,$(SUBDIRS),$(ONE_GENERATED_FILE:%=$(dir)/%))
19
20 gen-all: $(ALL_GENERATED_FILES)
21
22 gen-clean:
23         -rm -f $(ALL_GENERATED_FILES)
24
25
26 $(SUBDIRS:%=%/tuples): %/tuples: $(PROLOG_FILES)
27         cd $(TO_SPEC); gprolog --entry-goal "['spec-grouped.pl']" \
28                 --entry-goal "test_init('$*')" \
29                 --entry-goal "write_tuples('../../$@', '$*')" \
30                 --entry-goal "halt"
31
32 $(SUBDIRS:%=%/cmake-mutatees.txt): %/cmake-mutatees.txt: $(PYTHON_FILES) %/tuples
33         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import generate ; generate.generate('$*')"
34
35 $(SUBDIRS:%=%): %:%/cmake-mutatees.txt
36