make 模板
Posted tintindeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了make 模板相关的知识,希望对你有一定的参考价值。
RED = \\e[1m\\e[31m
DARKRED = \\e[31m
GREEN = \\e[1m\\e[32m
DARKGREEN = \\e[32m
BLUE = \\e[1m\\e[34m
DARKBLUE = \\e[34m
YELLOW = \\e[1m\\e[33m
DARKYELLOW = \\e[33m
MAGENTA = \\e[1m\\e[35m
DARKMAGENTA = \\e[35m
CYAN = \\e[1m\\e[36m
DARKCYAN = \\e[36m
RESET = \\e[m
CRESET = ;echo -ne \\e[m; test -s [email protected]
CFLAGS += -g -Wall -D_GNU_SOURCE -DTIXML_USE_STL -Wno-write-strings -ldl#-Werror
INC +=
LIB +=
CXX = g++
CC = gcc
TARGET = main
SOURCE+=$(wildcard *.cpp)
OBJ = $(SOURCE:.cpp=.o)
run:all
@./$(TARGET)
all:
@echo $(OBJ)
make clean
make $(TARGET)
$(TARGET):$(OBJ)
@echo -e Linking $(CYAN)[email protected]$(RESET) ...$(RED)
@$(CXX) -o [email protected] $^ $(LIB)
%.o: %.cpp
@echo -e Compiling $(GREEN)$<$(RESET) ...$(RED)
@$(CXX) $(CFLAGS) -c -o [email protected] $< $(INC) $(CRESET)
%.o: %.c
@echo -e Compiling $(GREEN)$<$(RESET) ...$(RED)
@$(CC) $(CFLAGS) -c -o [email protected] $< $(INC) $(CRESET)
clean:
@rm -f $(OBJ)
@rm -f $(TARGET)
以上是关于make 模板的主要内容,如果未能解决你的问题,请参考以下文章
没有函数模板“std::make_pair”的实例与参数列表匹配
Android 进阶——源码编译之产品配置和常用的Make脚本模板