mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
c89764e80c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1543 91177308-0d34-0410-b5e6-96231b3b80d8
101 lines
2.1 KiB
Makefile
101 lines
2.1 KiB
Makefile
##-----------------------------------------------------------*-Makefile-*-
|
|
## Common rules for generating, linking, and compiling via LLVM. This is
|
|
## used to implement a robust testing framework for LLVM
|
|
##------------------------------------------------------------------------
|
|
|
|
## NOTE: This is preliminary and will change in the future
|
|
|
|
|
|
include ${LEVEL}/Makefile.common
|
|
|
|
.PHONY: clean default
|
|
|
|
## keep %.bc and %.s from being deleted while we're debugging
|
|
.PRECIOUS: Output/%.bc Output/%.ll %.s Output/.dir
|
|
|
|
|
|
TOOLS = $(LEVEL)/tools/Debug
|
|
|
|
LLI = $(TOOLS)/lli
|
|
LLC = $(TOOLS)/llc
|
|
LAS = $(TOOLS)/gccas
|
|
LDIS = $(TOOLS)/dis
|
|
LOPT = $(TOOLS)/opt
|
|
LLINK = $(TOOLS)/link
|
|
LLCFLAGS =
|
|
|
|
LCC = /home/vadve/lattner/cvs/gcc_install/bin/gcc
|
|
LCFLAGS += -O2 -Wall
|
|
|
|
LLCLIB = $(LEVEL)/test/runtime.o
|
|
LIBS += $(LLCLIB)
|
|
|
|
ifeq ($(TRACE), yes)
|
|
LLCFLAGS += -trace
|
|
endif
|
|
ifeq ($(TRACEM), yes)
|
|
LLCFLAGS += -tracem
|
|
endif
|
|
|
|
NATGCC = /usr/dcs/software/supported/bin/gcc
|
|
|
|
CC = /opt/SUNWspro/bin/cc
|
|
AS = /opt/SUNWspro/bin/cc
|
|
DIS = /usr/ccs/bin/dis
|
|
CP = /bin/cp -f
|
|
CFLAGS += -g -xarch=v9
|
|
|
|
## Special target to force target-dependent library to be compiled
|
|
## directly to native code.
|
|
##
|
|
$(LLCLIB): $(LLCLIB:.o=.c)
|
|
cd $(LEVEL)/test; $(MAKE) $(@F)
|
|
|
|
#runtime.o: runtime.c
|
|
# $(CC) -c $(CCFLAGS) $<
|
|
|
|
clean ::
|
|
$(RM) *.bc *.mc *.s *.o a.out core
|
|
$(RM) -rf Output/
|
|
|
|
%.mc: %.bc $(LLC) $(AS)
|
|
@echo "Generating machine instructions for $<"
|
|
$(LLC) -f -dsched y $(LLCFLAGS) $< > $@
|
|
|
|
%.trace.bc: %.bc $(LLC)
|
|
$(LLC) -f -trace $(LLCFLAGS) $<
|
|
|
|
|
|
## FIXME: LIBS should be specified, not hardcoded to -lm
|
|
#Output/%.native: %.c Output/.dir
|
|
# $(NATGCC) $+ -lm -o $@
|
|
|
|
Output/%.ll: %.c $(LCC) Output/.dir
|
|
$(LCC) $(LCFLAGS) -S $< -o $@
|
|
|
|
%.bc: %.ll $(LAS)
|
|
$(LAS) $< -o $@
|
|
|
|
#%.s: %.linked.bc
|
|
# $(LLC) -f $(LCFLAGS) $< -o $@
|
|
|
|
#%: %.o $(LIBS)
|
|
# $(CC) $(LDFLAGS) $< $(LIBS) -o $@
|
|
|
|
|
|
## Cancel built-in implicit rules that override above rules
|
|
%: %.s
|
|
|
|
%: %.c
|
|
|
|
%.o: %.c
|
|
|
|
## The next two rules are for disassembling an executable or an object file
|
|
%.dis: %
|
|
$(DIS) $< > $@
|
|
|
|
%.dis: %.o
|
|
$(DIS) $< > $@
|
|
|
|
|