Fix Windows compiler warnings
[dyninst.git] / testsuite / Makefile
1 SUBDIRS = i386-unknown-linux2.4 rs6000-ibm-aix5.1 x86_64-unknown-linux2.4 ppc32_linux ppc64_linux x86_64_cnl i386-unknown-freebsd7.2 amd64-unknown-freebsd7.2 ppc32_bgp_ion ppc32_bgp 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)/makemake.py $(TO_SPEC)/tuples.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 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) %/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 $(SUBDIRS:%=%): %:%/make.mutators.gen %/make.solo_mutatee.gen %/test_info_new.gen.C
47
48 $(SUBDIR_WINDOWS:%=%): %:%/nmake.mutators.gen %/nmake.solo_mutatee.gen %/test_info_new.gen.C
49
50 # Do the same as above for windows
51 $(SUBDIR_WINDOWS:%=%/tuples): %/tuples: $(PROLOG_FILES)
52         cd $(TO_SPEC); gprolog --entry-goal "['spec-grouped.pl']" \
53                 --entry-goal "test_init('$*')" \
54                 --entry-goal "write_tuples('../../$@', '$*')" \
55                 --entry-goal "halt"
56
57 $(SUBDIR_WINDOWS:%=%/nmake.mutators.gen): %/nmake.mutators.gen: $(PYTHON_FILES) %/tuples
58         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')"
59
60 $(SUBDIR_WINDOWS:%=%/nmake.solo_mutatee.gen): %/nmake.solo_mutatee.gen: $(PYTHON_FILES) %/tuples
61         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')"
62
63 #TODO do I need this big substitution thing here?
64 $(SUBDIR_WINDOWS:%=%/test_info_new.gen.C): %/test_info_new.gen.C: $(PYTHON_FILES) %/tuples
65         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')"