makefile
来自「一个简单的http下载程序,用C++在linux下写了一个简单的http下载程序」· 代码 · 共 65 行
TXT
65 行
##################################### # # Generic makefile # # by Coon Xu # email: coonxu@126.com# # Copyright (c) 2005 Coon Xu# All rights reserved. # # No warranty, no liability; # you use this at your own risk. # # You are free to modify and # distribute this without giving # credit to the original author. # ###################################### #source file#源文件,自动找所有.c和.cpp文件,并将目标定义为同名.o文件SOURCE := $(wildcard *.c) $(wildcard *.cpp)OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) #target you can change test to what you want #目标文件名,输入任意你想要的执行文件名TARGET := http_client#compile and lib parameter #编译参数CC := g++LIBS := LDFLAGS := DEFINES :=INCLUDE := CFLAGS := -g -Wall -O2 $(DEFINES) $(INCLUDE)
CXXFLAGS:= $(CFLAGS) #i think you should do anything here#下面的基本上不需要做任何改动了.PHONY : everything objs clean veryclean rebuild everything : $(TARGET)all : $(TARGET)objs : $(OBJS) rebuild: veryclean everything clean : rm -fr *.so rm -fr *.o veryclean : clean rm -fr $(TARGET)$(TARGET) : $(OBJS) $(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?