Adding new platform:ppc32_bgp
[dyninst.git] / testsuite / Makefile
1 SUBDIRS = ppc32_bgp i386-unknown-linux2.4 rs6000-ibm-aix5.1 x86_64-unknown-linux2.4 sparc-sun-solaris2.8 sparc-sun-solaris2.9 ppc32_linux \
2 ppc64_linux i386-unknown-freebsd7.2 amd64-unknown-freebsd7.2
3 SUBDIR_WINDOWS = i386-unknown-nt4.0
4
5 TO_SPEC = src/specification
6 PROLOG_FILES = $(TO_SPEC)/spec-grouped.pl $(TO_SPEC)/util.pl $(TO_SPEC)/test.pl
7 PYTHON_FILES = $(TO_SPEC)/makemake.py $(TO_SPEC)/tuples.py
8
9 .PHONY: usage gen-all echo
10
11 usage:
12         @echo "Use target 'gen-all' to regenerate generated files for all supported"
13         @echo "platforms"
14         @echo "Use target 'gen-clean' to remove generated files for all supported"
15         @echo "platforms"
16
17 GENERATED_FILES = make.mutators.gen make.solo_mutatee.gen test_info_new.gen.C
18 ALL_GENERATED_FILES = $(foreach dir,$(SUBDIRS),$(GENERATED_FILES:%=$(dir)/%))
19
20 GENERATED_FILES_WINDOWS = nmake.mutators.gen nmake.solo_mutatee.gen test_info_new.gen.C
21 ALL_GENERATED_FILES += $(GENERATED_FILES_WINDOWS:%=$(SUBDIR_WINDOWS)/%)
22
23 gen-all: $(ALL_GENERATED_FILES)
24
25 gen-clean:
26         -rm -f $(ALL_GENERATED_FILES)
27
28
29 $(SUBDIRS:%=%/tuples): %/tuples: $(PROLOG_FILES)
30         cd $(TO_SPEC); gprolog --entry-goal "['spec-grouped.pl']" \
31                 --entry-goal "test_init('$*')" \
32                 --entry-goal "write_tuples('../../$@', '$*')" \
33                 --entry-goal "halt"
34
35 $(SUBDIRS:%=%/make.mutators.gen): %/make.mutators.gen: $(PYTHON_FILES) %/make.mutators.gen %/tuples
36         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_make_mutators_gen('$*/make.mutators.gen', '$*/tuples')"
37
38 $(SUBDIRS:%=%/make.solo_mutatee.gen): %/make.solo_mutatee.gen: $(PYTHON_FILES) %/tuples
39         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_make_solo_mutatee_gen('$*/make.solo_mutatee.gen', '$*/tuples')"
40
41 # Generate the lists of tests to run in test_info_new.gen.C
42 $(SUBDIRS:%=%/test_info_new.gen.C): %/test_info_new.gen.C: $(PYTHON_FILES) %/tuples
43         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_test_info_new_gen('$*/test_info_new.gen.C', '$*/tuples')"
44         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_group_mutatee_boilerplate('$*/', '_group.c', '$*/tuples')";
45
46 # Do the same as above for windows
47 $(SUBDIR_WINDOWS:%=%/tuples): %/tuples: $(PROLOG_FILES)
48         cd $(TO_SPEC); gprolog --entry-goal "['spec-grouped.pl']" \
49                 --entry-goal "test_init('$*')" \
50                 --entry-goal "write_tuples('../../$@', '$*')" \
51                 --entry-goal "halt"
52
53 $(SUBDIR_WINDOWS:%=%/nmake.mutators.gen): %/nmake.mutators.gen: $(PYTHON_FILES) %/tuples
54         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_make_mutators_gen_nt('$*/nmake.mutators.gen', '$*/tuples')"
55
56 $(SUBDIR_WINDOWS:%=%/nmake.solo_mutatee.gen): %/nmake.solo_mutatee.gen: $(PYTHON_FILES) %/tuples
57         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_make_solo_mutatee_gen_nt('$*/nmake.solo_mutatee.gen', '$*/tuples')"
58
59 #TODO do I need this big substitution thing here?
60 $(SUBDIR_WINDOWS:%=%/test_info_new.gen.C): %/test_info_new.gen.C: $(PYTHON_FILES) %/tuples
61         python -c "import sys; import os; os.environ['PLATFORM'] = '$*'; sys.path.append('$(TO_SPEC)'); import makemake; makemake.write_test_info_new_gen_nt('$*/test_info_new.gen.C', '$*/tuples')"
62