5 Star 0 Fork 1

嘉然今天偷着乐/SysY-Compiler

forked from 黄子潇/SysY-Compiler 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.51 KB
一键复制 编辑 原始数据 按行查看 历史
黄子潇 提交于 2022-08-26 18:28 . [Add][Transform]Loop parallel
include ./scripts/config.mk
include ./scripts/antlr.mk
vpath %.cpp lib/Frontend:lib/Support:lib/IR/LLVM:lib/IR:lib/Target:lib/Analysis:lib/Transform:lib/Transform/Utils:lib/Transform/Scalar:.
vpath %.h .
BUILD_DIR = ./build
ANTLR_DIR = antlr
SYSYC_DIR = sysy
BUILD_ANTLR_OBJ = $(addprefix $(BUILD_DIR)/$(ANTLR_DIR)/, $(ANTLR_OBJ))
FRONTEND_OBJ = SysYParser.o SysYLexer.o Frontend.o Ast.o SysYVisitor.o AstDump.o AstTramsform.o
SUPPORT_OBJ = strUtils.o typeUtils.o
IR_OBJ = ValueScope.o Type.o Module.o User.o Value.o Builder.o IRGen.o Constant.o BasicBlock.o \
GlobalValue.o Instructions.o Use.o Function.o IRDump.o PassManager.o
TARGET_OBJ = Block.o MCFunction.o MCInstruction.o MCModule.o Reg.o Regallocator.o
ANALYSIS_OBJ = DomInfo.o Vertify.o Analysis.o Loop.o LoopInfo.o AliasAnalysis.o IPAnalysis.o
TRANSFORM_OBJ = Memory2Reg.o GVN.o SimplifyInstructions.o DCE.o EliminatePhi.o Transform.o MemorySSA.o
BUILD_SYSYC_FRONTEND_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(FRONTEND_OBJ))
BULID_SYSYC_SUPPORT_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(SUPPORT_OBJ))
BULID_SYSYC_IR_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(IR_OBJ))
BULID_SYSYC_TARGET_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(TARGET_OBJ))
BUILD_SYSYC_ANALYSIS_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(ANALYSIS_OBJ))
BUILD_SYSYC_TRANSFORM_OBJ = $(addprefix $(BUILD_DIR)/$(SYSYC_DIR)/, $(TRANSFORM_OBJ))
SYSYC_OBJ = $(BUILD_DIR)/$(SYSYC_DIR)/sysyc.o $(BUILD_SYSYC_FRONTEND_OBJ) \
$(BULID_SYSYC_SUPPORT_OBJ) $(BULID_SYSYC_IR_OBJ) $(BULID_SYSYC_TARGET_OBJ) \
$(BUILD_SYSYC_ANALYSIS_OBJ) $(BUILD_SYSYC_TRANSFORM_OBJ)
SYSYC = sysyc
default : $(SYSYC)
antlr : $(BUILD_ANTLR_OBJ)
$(BUILD_DIR)/$(ANTLR_DIR)/%.o : %.cpp
@echo CXX +$@
@$(CXX) -c $(CXXFLAGS) $(COMM_FLAGS) $< -o $@
$(BUILD_DIR)/$(SYSYC_DIR)/%.o : %.cpp
@echo CXX +$@
$(CXX) -c $(CXXFLAGS) $(COMM_FLAGS) $< -o $@
%.o : %.cpp
@echo CXX +$@
@$(CXX) -c $(CXXFLAGS) $(COMM_FLAGS) $< -o $@
$(SYSYC) : $(SYSYC_OBJ) $(BUILD_ANTLR_OBJ)
@echo Linking $@
@$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(COMM_FLAGS) $^ $(LIBFLAGS)
test: $(BUILD_SYSYC_ANALYSIS_OBJ) $(BUILD_SYSYC_FRONTEND_OBJ) $(BULID_SYSYC_SUPPORT_OBJ) $(BULID_SYSYC_IR_OBJ) $(BULID_SYSYC_TARGET_OBJ) $(BUILD_ANTLR_OBJ) test.o
@echo Linking $@
@$(CXX) -o a.out $(CXXFLAGS) $(LDFLAGS) $(COMM_FLAGS) $^ $(LIBFLAGS)
clean:
rm -rf build/sysy/*.o sysyc
clean-all:
rm -rf build/sysy/*.o build/antlr/*.o sysyc
init:
$(ANTLR4) lib/Frontend/SysYLexer.g4 lib/Frontend/SysYParser.g4
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/diana-have-fun-today/sys-y-compiler.git
[email protected]:diana-have-fun-today/sys-y-compiler.git
diana-have-fun-today
sys-y-compiler
SysY-Compiler
develop

搜索帮助