#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的更多相关文章

随机推荐

  1. 临时2级页表的初始化过程 head_32.S 相关代码解释

    page_pde_offset = (__PAGE_OFFSET >> 20); /* __PAGE_OFFSET是0xc0000000,page_pde_offset = 3072 = ...

  2. tomcat初识

    1.新工作使用tomcat,顺便就把tomcat搜了搜,看了下基础 官网:http://tomcat.apache.org/ 打开官网会发现很多版本6,7,8,9,这些版本都有什么区别呢?tomcat ...

  3. Windows 7 IE11 F12 不能正常使用

    打开任意网站,按下F12,或者右键鼠标,按L键.出现上面的图的情况!解决办法如下:需要安装下面的补丁(KB3008923) 32位系统:http://www.microsoft.com/en-us/d ...

  4. JavaScript设置cookie

    在做网站的时候会用到JS操作cookie,现在写下来,算是对自己工作的一次小小总结,后面用到的时候就不用再写一遍了,高手就不用看了. /* 添加cookie 参数:cookie名,cookie值,过期 ...

  5. Android开发—— Native 与 Web 之架构抉择

    前 言 移动App是对URL和搜索引擎的革命,当今移动App开发貌似出现两大阵营:Native 和 Web,各自都认为自己才是未来的趋势,Native操作流畅.迅速,Web开发周期相对较短,还能轻松跨 ...

  6. Servlet之初识

    doHeader 用于处理HEADER请求doGet 用于处理GET请求,也可以自动的支持HEADER请求doPost 用于处理POST请求 doPut 用于处理PUT请求 doDelete 用于处理 ...

  7. 直接拿来用,最火的.NET开源项目(beta)

    转自:http://blog.csdn.net/ltylove2007/article/details/18656971 综合类 微软企业库 微软官方出品,是为了协助开发商解决企业级应用开发过程中所面 ...

  8. axure注册码

    ahjesus Axure RP 7.0注册码 用户名:axureuser 序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+t ...

  9. ThreadPool 线程池的作用

    相关概念: 线程池可以看做容纳线程的容器: 一个应用程序最多只能有一个线程池: ThreadPool静态类通过QueueUserWorkItem()方法将工作函数排入线程池: 每排入一个工作函数,就相 ...

  10. Article Master Data Deviation

    Site data – Logistics DC / Logistics Store Where is the reference site decided when you maintain the ...