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
28 LGCCLD = $(TOOLS)/gccld -L/home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/
35 FAILURE = $(LEVEL)/test/Failure.sh
36 TESTRUNR = $(LEVEL)/test/TestRunner.sh
38 # Native Tool Definitions
39 NATGCC = /usr/dcs/software/supported/bin/gcc
40 CC = /opt/SUNWspro/bin/cc
41 AS = /opt/SUNWspro/bin/cc
42 DIS = /usr/ccs/bin/dis
44 CFLAGS += -g -xarch=v9
46 #LLCLIB = $(LEVEL)/test/Libraries/runtime.o
62 # Compile from X.c to Output/X.ll
63 Output/%.ll: %.c $(LCC1) Output/.dir
64 $(LCC) $(LCCFLAGS) -S $< -o $@
66 # LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come
67 # from GCC output, so use GCCAS.
69 Output/%.bc: Output/%.ll $(LGCCAS)
72 # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from
73 # LLVM source, use the non-transforming assembler.
75 Output/%.bc: %.ll $(LAS) Output/.dir
78 # Compile a linked program to machine code for this processor.
80 Output/%.llc.s: Output/%.llvm.bc
81 $(LLC) $(LLCFLAGS) -f $< -o $@
83 # Assemble (and link) an LLVM-linked program using the system assembler...
85 Output/%.llc: Output/%.llc.s
86 $(CC) $(CFLAGS) $< $(LIBS) -o $@
89 # Testing versions of provided utilities...
91 Output/%.tll: %.c $(LCC1) Output/.dir
92 @echo "======== Compiling $<"
93 $(LCC) $(LCCFLAGS) -S $< -o $@ || \
94 ( rm -f $@; $(FAILURE) $@ )
96 Output/%.tbc: Output/%.tll $(LAS)
97 @echo "======== Assembling $<"
98 $(LAS) -f $< -o $@ || \
99 ( rm -f $@; $(FAILURE) $@ )
102 ## Cancel built-in implicit rules that override above rules