1 ##-----------------------------------------------------------*-Makefile-*-
2 ## Common rules for generating, linking, and compiling via LLVM. This is
3 ## used to implement a robust testing framework for LLVM
4 ##------------------------------------------------------------------------
6 ## NOTE: This is preliminary and will change in the future
9 include ${LEVEL}/Makefile.common
13 # These files, which might be intermediate results, should not be deleted by
15 .PRECIOUS: Output/%.bc Output/%.ll
16 .PRECIOUS: Output/%.tbc Output/%.tll
17 .PRECIOUS: Output/.dir
19 # LLVM Tool Definitions...
21 LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
22 LCC1 = /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/cc1
23 TOOLS = $(LEVEL)/tools/Debug
27 LGCCAS = $(TOOLS)/gccas
34 FAILURE = $(LEVEL)/test/Failure.sh
35 TESTRUNR = $(LEVEL)/test/TestRunner.sh
37 # Native Tool Definitions
38 NATGCC = /usr/dcs/software/supported/bin/gcc
39 CC = /opt/SUNWspro/bin/cc
40 AS = /opt/SUNWspro/bin/cc
41 DIS = /usr/ccs/bin/dis
43 CFLAGS += -g -xarch=v9
45 LLCLIB = $(LEVEL)/test/runtime.o
61 # Compile from X.c to Output/X.ll
62 Output/%.ll: %.c $(LCC1) Output/.dir
63 $(LCC) $(LCCFLAGS) -S $< -o $@
65 # LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come
66 # from GCC output, so use GCCAS.
68 Output/%.bc: Output/%.ll $(LGCCAS)
71 # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from
72 # LLVM source, use the non-transforming assembler.
74 Output/%.bc: %.ll $(LAS) Output/.dir
77 # Compile a linked program to machine code for this processor.
79 Output/%.llc.s: Output/%.linked.bc
80 $(LLC) $(LLCFLAGS) -f $< -o $@
82 # Assemble (and link) an LLVM-linked program using the system assembler...
84 Output/%.llc: Output/%.llc.s
85 $(CC) $(CFLAGS) $< -o $@
88 # Testing versions of provided utilities...
90 Output/%.tll: %.c $(LCC1) Output/.dir
91 @echo "======== Compiling $<"
92 $(LCC) $(LCCFLAGS) -S $< -o $@ || \
93 ( rm -f $@; $(FAILURE) $@ )
95 Output/%.tbc: Output/%.tll $(LAS)
96 @echo "======== Assembling $<"
97 $(LAS) -f $< -o $@ || \
98 ( rm -f $@; $(FAILURE) $@ )
101 ## Cancel built-in implicit rules that override above rules