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
18 .PRECIOUS: Output/%.llvm.bc
19 .PRECIOUS: Output/%.llvm
21 # LLVM Tool Definitions...
23 LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
24 LCC1 = /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/cc1
25 TOOLS = $(LEVEL)/tools/Debug
29 LGCCAS = $(TOOLS)/gccas
30 LGCCLD = $(TOOLS)/gccld -L/home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/
37 FAILURE = $(LEVEL)/test/Failure.sh
38 TESTRUNR = $(LEVEL)/test/TestRunner.sh
40 # Native Tool Definitions
41 NATGCC = /usr/dcs/software/supported/bin/gcc
42 CC = /opt/SUNWspro/bin/cc
43 AS = /opt/SUNWspro/bin/cc
44 DIS = /usr/ccs/bin/dis
46 CFLAGS += -g -xarch=v9
48 #LLCLIB = $(LEVEL)/test/Libraries/runtime.o
64 # Compile from X.c to Output/X.ll
65 Output/%.ll: %.c $(LCC1) Output/.dir
66 $(LCC) $(LCCFLAGS) -S $< -o $@
68 # LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come
69 # from GCC output, so use GCCAS.
71 Output/%.bc: Output/%.ll $(LGCCAS)
74 # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from
75 # LLVM source, use the non-transforming assembler.
77 Output/%.bc: %.ll $(LAS) Output/.dir
80 # Compile a linked program to machine code for this processor.
82 Output/%.llc.s: Output/%.llvm.bc
83 $(LLC) $(LLCFLAGS) -f $< -o $@
85 # Assemble (and link) an LLVM-linked program using the system assembler...
87 Output/%.llc: Output/%.llc.s
88 $(CC) $(CFLAGS) $< $(LIBS) -o $@
91 # Testing versions of provided utilities...
93 Output/%.tll: %.c $(LCC1) Output/.dir
94 @echo "======== Compiling $<"
95 $(LCC) $(LCCFLAGS) -S $< -o $@ || \
96 ( rm -f $@; $(FAILURE) $@ )
98 Output/%.tbc: Output/%.tll $(LAS)
99 @echo "======== Assembling $<"
100 $(LAS) -f $< -o $@ || \
101 ( rm -f $@; $(FAILURE) $@ )
104 ## Cancel built-in implicit rules that override above rules