GNU_makefile_template
#g++ compiler: options # -std=c++0x enables ISO C++ 11 standard
# -I.. pulls in the Version_test.h file for conditional compilation
# of code the uses features that might not yet be implemented
CC = g++
CCFLAGS = -std=c++0x -I.. # Some programs include headers defined in earlier chapters
# LOCFLAGS used to set tell the compiler where to find a
# header that is not in the same directory as the source file itself
# LOCFLAGS will be set in directory level makefiles as needed
LOCFLAGS = ### ####### To compile without using a makefile
# To compile an object file from a source file you could execute
# g++ -std=c++0x -c filename.cc # produces filename.obj
# To compile an executable file from an object file, you would execute
# g++ -std=c++0x filename.o # produces filename.exe
# To compile an executable file from a source file, you would execute
# g++ -std=c++0x filename.cc # produces filename.exe
####### # each subdirectory contains a Makefile that lists the executable
# files that can be made in that directory. That list is assigned
# to the make macro named $OBJECTS
# This rule says that the make target named "all" depends on those
# files. Executing "make all" in a subdirectory will cause make
# to build each .exe file listed in that subdirectory's makefile
all: $(OBJECTS) # rule that says how to make a .o object file from a .cc source file
# for a given source file in a given directory you could compile it
# into an object file by executing "make filename.o" # $< and $@ are macros defined by make
# $< refers to the file being processed (i.e., compiled or linked)
# $@ refers to the generated file
%.o: %.cc
$(CC) $(CCFLAGS) $(LOCFLAGS) -c $< -o $@ # rule that says how to make a .exe executable file from a .o object file
%.exe: %.o
$(CC) $(CCFLAGS) $(LOCFLAGS) $< -o $@ # target to clean up the object files and any core files
# executing "make clean" in a subdirectory will remove all
# files named core or any file ending in .obj, or .stackdump
clean:
rm -rf *.o core *.stackdump # target to remove executable files as well as object and core files
clobber: clean
rm -rf *.exe
GNU_makefile_template的更多相关文章
随机推荐
- python(1) - 第一个程序 Hello World!
进入python3的解释器环境. 我们让解释器输出 “Hello World!” 解释器成功的输出了Hello world! 程序就这样完成了. 当然上面的程序我们是在解释器中完成的. 我们可以通过 ...
- [转]Asp.Net MVC 扩展联想控件
本文转自:http://www.cnblogs.com/bright-lin/archive/2013/02/06/MVC_SuggestBox.html 在web中,为改善用户体验,我们常会将一些文 ...
- 24小时学通Linux内核之如何处理输入输出操作
真的是悲喜交加呀,本来这个寒假早上8点都去练车,两个小时之后再来实验室陪伴Linux内核,但是今天教练说没名额考试了,好纠结,不过想想就可以睡懒觉了,哈哈,自从大三寒假以来还没睡过懒觉呢,现在也有更多 ...
- 【模拟ACM排名】ZOJ-2593 Ranking (Andrew Stankevich’s Contest #5)
真心是道水题,但找bug找的我想剁手了/(ㄒoㄒ)/~~ 注意几个坑点, 1.输入,getline(cin); / gets(); 一行输入,注意前面要加getchar(); 输入运行记录的时候可 ...
- hdu 4669 动态规划
思路:主要就是一个动态方程dp[now][(j*Exp[len[num[i]]]+num[i])%k]+=dp[pre][j];我用的是滚动数组.其实也就是dp[i][(j*Exp[len[num[i ...
- Leetcode 338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the ...
- HTML5 图片上传预览
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8& ...
- 安装SqlServer2008时相关问题
在安装SqlServer2008时,安装程序支持规则,老提示重启计算机 1,运行 regedit 打开注册表编辑器. 2,依次展开HKEY_LOCAL_MACHINE\SYSTEM\CurrentCo ...
- ASP判断当前页面上是否有参数ID传递过来
遇到了一个这样的ASP问题: 在当前页面上判断,是否有参数ID传递过来? 如果没有,显示“没有参数传递过来”. 如果有传递,但值为空,显示“存在参数,但参数为空” <% if (request( ...
- 更换用installshield打包生成exe文件的图标【转】
最近在研究用installshield2010为自己做的产品打包,自己在网上找写资料,胡乱折腾,最后弄成了一个exe安装包,想要修改exe文件的图标,发现Basic MSI project 无法用in ...