mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Use llvmc to compile the Stacker programs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5456091e90
commit
e198cd18bd
@ -16,49 +16,26 @@ DIRS =
|
|||||||
|
|
||||||
SAMPLES = fibonacci hello prime
|
SAMPLES = fibonacci hello prime
|
||||||
|
|
||||||
LLC_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/llc
|
LLVMC_EXEC = $(TOOLDIR)/llvmc
|
||||||
OPT_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/opt
|
|
||||||
STKRC_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/stkrc
|
|
||||||
LLVMDIS_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/llvm-dis
|
|
||||||
|
|
||||||
all :: $(SAMPLES)
|
all :: $(SAMPLES)
|
||||||
|
|
||||||
ifdef OPTIMIZE
|
ifdef OPTIMIZE
|
||||||
% : %.st
|
% : %.st
|
||||||
@$(ECHO) "Compiling and Optimizing $< to $*.bc"
|
@$(ECHO) "Compiling and Optimizing $(<F)"
|
||||||
$(VERB)$(STKRC_EXEC) -e -o - $< | opt -stats -q -f -o $*.bc \
|
$(VERB)$(LLVMC_EXEC) -O3 $< -o $@
|
||||||
-aa-eval -adce -branch-combine -cee -constmerge -constprop -dce -die -ds-aa \
|
|
||||||
-ds-opt -gcse -globaldce -indvars -inline -instcombine \
|
|
||||||
-ipconstprop -licm -loopsimplify -mem2reg -pre -sccp -simplifycfg \
|
|
||||||
-tailcallelim -verify
|
|
||||||
else
|
else
|
||||||
%.bc : %.st
|
% : %.st
|
||||||
@$(ECHO) "Compiling $< to $*.bc"
|
@$(ECHO) "Compiling $(<F)"
|
||||||
$(VERB)$(STKRC_EXEC) -e -f -o $*.bc $<
|
$(VERB)$(LLVMC_EXEC) $< -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.s : %.bc
|
|
||||||
@$(ECHO) "Compiling $< to $*.s"
|
|
||||||
$(VERB)$(LLC_EXEC) -f -o $*.s $<
|
|
||||||
|
|
||||||
% : %.s
|
|
||||||
@$(ECHO) "Compiling and Linking $< to $*"
|
|
||||||
$(VERB)gcc -g -L$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) -lstkr_runtime -o $* $*.s
|
|
||||||
|
|
||||||
%.ll : %.bc
|
|
||||||
@$(ECHO) "Disassembling $< to $*.ll"
|
|
||||||
$(VERB)$(LLVMDIS_EXEC) -f -o $*.ll $<
|
|
||||||
|
|
||||||
%.bc : $(STKRC_EXEC)
|
|
||||||
|
|
||||||
.PRECIOUS: %.bc %.s %.ll %.st
|
|
||||||
|
|
||||||
SAMPLES_LL = $(SAMPLES:%=%.ll)
|
SAMPLES_LL = $(SAMPLES:%=%.ll)
|
||||||
SAMPLES_BC = $(SAMPLES:%=%.bc)
|
SAMPLES_BC = $(SAMPLES:%=%.bc)
|
||||||
SAMPLES_S = $(SAMPLES:%=%.s)
|
SAMPLES_S = $(SAMPLES:%=%.s)
|
||||||
|
|
||||||
clean ::
|
clean ::
|
||||||
$(VERB)rm -f gmon.out $(SAMPLES_LL) $(SAMPLES_BC) $(SAMPLES_S) $(SAMPLES)
|
$(VERB)rm -f gmon.out $(SAMPLES)
|
||||||
#
|
#
|
||||||
# Include the Master Makefile that knows how to build all.
|
# Include the Master Makefile that knows how to build all.
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user