Makefile.tests revision aef6546191b7165031f1933cde24f13fe04d9c74
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##------------------------------------------------------------------------ 5 6## NOTE: This is preliminary and will change in the future 7 8 9include ${LEVEL}/Makefile.common 10 11.PHONY: clean default 12 13# These files, which might be intermediate results, should not be deleted by 14# make 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 20 21# LLVM Tool Definitions... 22# 23LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc 24LCC1 = /home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/cc1 25TOOLS = $(LEVEL)/tools/Debug 26LLI = $(TOOLS)/lli 27LLC = $(TOOLS)/llc 28LAS = $(TOOLS)/as 29LGCCAS = $(TOOLS)/gccas 30LGCCLD = $(TOOLS)/gccld -L/home/vadve/lattner/cvs/gcc_install/lib/gcc-lib/llvm/3.1/ 31LDIS = $(TOOLS)/dis 32LOPT = $(TOOLS)/opt 33LLINK = $(TOOLS)/link 34 35LCCFLAGS += -O2 -Wall 36LLCFLAGS = 37FAILURE = $(LEVEL)/test/Failure.sh 38TESTRUNR = $(LEVEL)/test/TestRunner.sh 39 40# Native Tool Definitions 41NATGCC = /usr/dcs/software/supported/bin/gcc 42CC = /opt/SUNWspro/bin/cc 43AS = /opt/SUNWspro/bin/cc 44DIS = /usr/ccs/bin/dis 45CP = /bin/cp -f 46CFLAGS += -g -xarch=v9 47 48#LLCLIB = $(LEVEL)/test/Libraries/runtime.o 49#LIBS += $(LLCLIB) 50 51 52 53ifeq ($(TRACE), yes) 54 LLCFLAGS += -trace 55endif 56ifeq ($(TRACEM), yes) 57 LLCFLAGS += -tracem 58endif 59 60clean :: 61 $(RM) a.out core 62 $(RM) -rf Output/ 63 64# Compile from X.c to Output/X.ll 65Output/%.ll: %.c $(LCC1) Output/.dir 66 $(LCC) $(LCCFLAGS) -S $< -o $@ 67 68# LLVM Assemble from Output/X.ll to Output/X.bc. Output/X.ll must have come 69# from GCC output, so use GCCAS. 70# 71Output/%.bc: Output/%.ll $(LGCCAS) 72 $(LGCCAS) $< -o $@ 73 74# LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from 75# LLVM source, use the non-transforming assembler. 76# 77Output/%.bc: %.ll $(LAS) Output/.dir 78 $(LAS) -f $< -o $@ 79 80# Compile a linked program to machine code for this processor. 81# 82Output/%.llc.s: Output/%.llvm.bc 83 $(LLC) $(LLCFLAGS) -f $< -o $@ 84 85# Assemble (and link) an LLVM-linked program using the system assembler... 86# 87Output/%.llc: Output/%.llc.s 88 $(CC) $(CFLAGS) $< $(LIBS) -o $@ 89 90# 91# Testing versions of provided utilities... 92# 93Output/%.tll: %.c $(LCC1) Output/.dir 94 @echo "======== Compiling $<" 95 $(LCC) $(LCCFLAGS) -S $< -o $@ || \ 96 ( rm -f $@; $(FAILURE) $@ ) 97 98Output/%.tbc: Output/%.tll $(LAS) 99 @echo "======== Assembling $<" 100 $(LAS) -f $< -o $@ || \ 101 ( rm -f $@; $(FAILURE) $@ ) 102 103 104## Cancel built-in implicit rules that override above rules 105%: %.s 106 107%: %.c 108 109%.o: %.c 110 111