makefile

来自「utf8转换工具」· 代码 · 共 55 行

TXT
55
字号
#Makefile written by Boby Thomas#This is a general make file which can be used for compiling small projects with#all the source files in a single folder.#===============================================================================#user settings. Modifiy only here#===============================================================================#Binary namePROJECT:=utf_util#Directory for object files generation.OBJ_DIR:=obj#Directory for binaryBIN_DIR:=bin#Add all your additional include folders hereINCLUDES = -I ./include#CompilerCXX = g++#Additional flags if required CFLAGS = $(INCLUDES) -g -Wno-deprecated#===============================================================================#Don't touch the code below unless you need to expand the functionality.#===============================================================================SRC:=$(shell ls *.cpp 2>/dev/null)SOBJECTS:=$(patsubst %.cpp,$(OBJ_DIR)/$(PROJECT)/%.o,$(wildcard *.cpp))PROGRAM:=$(addprefix $(BIN_DIR)/,$(PROJECT))all: init $(PROGRAM)	@echo "Build complete."  	$(OBJ_DIR)/$(PROJECT)/%.o:	%.cpp	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@	  	$(BIN_DIR)/$(PROJECT):  $(SOBJECTS)#	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(PROG_FLAGS) $^ -o $@ $(LDFLAGS)		$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(PROG_FLAGS) $^ -o $@ $(LDFLAGS)	  	init:   		@echo "making the project................."	@mkdir -p $(OBJ_DIR)	@mkdir -p $(OBJ_DIR)/$(PROJECT)	@mkdir -p $(BIN_DIR)	  clean:   		@echo "removing all the object files"	rm -rf $(OBJ_DIR)	@echo "removing the binary"	rm -rf $(BIN_DIR)	@echo "cleaning complete"  	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?