Added command to build SPARC executable.
[oota-llvm.git] / test / Feature / Makefile
1 #                              test/Feature/Makefile
2 #
3 # This makefile runs a moderate number of tests against LLVM source "feature"
4 # tests, which are designed to test individual components of the LLVM language.
5 # This runs through three sets of tests, designed to test to (dis)assembler,
6 # the optimizer, and the code generator for support for the more esoteric LLVM
7 # features.
8 #
9
10 LEVEL = ../..
11 include ../Makefile.tests
12
13 TESTS  := $(wildcard *.ll)
14 OTESTS := $(addprefix Output/, $(TESTS))  # Tests in output directory
15
16 test all :: testasmdis testopt testsparc
17         @echo "All tests completed!"
18
19 testasmdis  : $(addsuffix .asmdis, $(OTESTS))
20 testopt     : $(addsuffix .opt   , $(OTESTS))
21
22 testcodegen : $(OTESTS:%.ll=%.mc)
23 testsparc   : $(OTESTS:%.ll=%.s)
24
25 Output/%.asmdis: % $(LAS) $(LDIS) Output/.dir
26         @./TestAsmDisasm.sh $<
27
28 Output/%.opt: % $(LAS) $(LDIS) $(LOPT) Output/.dir
29         @./TestOptimizer.sh $<
30
31 Output/%.mc: Output/%.bc $(LLC)
32         @echo "======== Generating machine instructions for $<"
33         $(LLC) -f $(LLCFLAGS) $< > $@ || \
34                  ( rm -f $@; $(FAILURE) $@ )
35
36 Output/%.s: Output/%.bc $(LLC)
37         @echo "======== Generating assembly code for $<"
38         $(LLC) -f $(LLCFLAGS) $< -o $@ || \
39                  ( rm -f $@; $(FAILURE) $@ )
40
41 Output/%: Output/%.s $(LLC)
42         @echo "======== Generating SPARC executable for $<"
43         $(CC) $(CFLAGS) $< -o $@ || \
44                  ( rm -f $@; $(FAILURE) $@ )
45