mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Added rules for building sparc executable with and without tracing,
and linking with local runtime library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@993 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,12 +1,22 @@
|
|||||||
LLC := ../tools/Debug/llc
|
LLC := ../tools/Debug/llc
|
||||||
AS := ../tools/Debug/as
|
LAS := ../tools/Debug/as
|
||||||
LLCOPTS := -dsched y
|
LDIS := ../tools/Debug/dis
|
||||||
ARCHFLAGS =
|
LINK := ../tools/Debug/link
|
||||||
|
LLCLIBS := runtime.o
|
||||||
|
LLCOPTS :=
|
||||||
|
|
||||||
|
ifeq ($(TRACE), yes)
|
||||||
|
LLCOPTS := -trace
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = /opt/SUNWspro/bin/cc
|
||||||
|
AS = /opt/SUNWspro/bin/cc
|
||||||
|
DIS = /usr/ccs/bin/dis
|
||||||
|
CFLAGS = -g -xarch=v9
|
||||||
|
CCFLAGS = $(CFLAGS)
|
||||||
|
LDFLAGS = $(CFLAGS)
|
||||||
|
ASFLAGS = -c $(CFLAGS)
|
||||||
|
|
||||||
CC = /opt/SUNWspro/bin/cc
|
|
||||||
CCFLAGS = -g -xarch=v9
|
|
||||||
## CC = gcc
|
|
||||||
## CCFLAGS = -g -xarch=v9 ## -mcpu=v9
|
|
||||||
|
|
||||||
TESTS := $(wildcard *.ll)
|
TESTS := $(wildcard *.ll)
|
||||||
|
|
||||||
@@ -30,7 +40,7 @@ testcodegen : $(LLCTESTS:%.ll=%.mc)
|
|||||||
testsparc : $(LLCTESTS:%.ll=%.s)
|
testsparc : $(LLCTESTS:%.ll=%.s)
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *.[123] *.bc *.mc *.s core
|
rm -f *.[123] *.bc *.mc *.s *.o a.out core
|
||||||
|
|
||||||
%.asmdis: %
|
%.asmdis: %
|
||||||
@echo "Running assembler/disassembler test on $<"
|
@echo "Running assembler/disassembler test on $<"
|
||||||
@@ -40,24 +50,30 @@ clean :
|
|||||||
@echo "Running optimizier test on $<"
|
@echo "Running optimizier test on $<"
|
||||||
@./TestOptimizer.sh $<
|
@./TestOptimizer.sh $<
|
||||||
|
|
||||||
%.bc: %.ll
|
%.bc: %.ll $(LAS)
|
||||||
$(AS) $< -f
|
$(LAS) -f $<
|
||||||
|
|
||||||
%.mc: %.ll $(LLC) $(AS)
|
%.mc: %.bc $(LLC) $(AS)
|
||||||
@echo "Generating machine instructions for $<"
|
@echo "Generating machine instructions for $<"
|
||||||
$(AS) < $< | $(LLC) $(LLCOPTS) > $@
|
$(LLC) -dsched y $(LLCOPTS) $< > $@
|
||||||
|
|
||||||
%.s: %.ll $(LLC) $(AS)
|
%.trace.bc: %.bc $(LLC)
|
||||||
$(AS) < $< | $(LLC) > $@
|
$(LLC) -f -trace $(LLCOPTS) $<
|
||||||
|
|
||||||
## %.o: %.s %.ll
|
%.s: %.bc $(LLC)
|
||||||
## /usr/ccs/bin/as $(ARCHFLAGS) $<
|
$(LLC) -f $(LLCOPTS) $<
|
||||||
|
|
||||||
|
%: %.o $(LLCLIBS)
|
||||||
|
$(CC) -o $@ $(LDFLAGS) $< $(LLCLIBS)
|
||||||
|
|
||||||
|
|
||||||
%.o: %.s
|
## Cancel built-in implicit rule that overrides the above rule
|
||||||
$(CC) -c $(CCFLAGS) $<
|
%: %.s
|
||||||
|
|
||||||
%: %.o
|
## The next two rules are for disassembling an executable or an object file
|
||||||
$(CC) -o $@ $(CCFLAGS) $<
|
%.dis: %
|
||||||
|
$(DIS) $< > $@
|
||||||
|
|
||||||
|
%.dis: %.o
|
||||||
|
$(DIS) $< > $@
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user