• 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 
    
  • 相关阅读:
    node起本地服务器以及实现代理,前端接口转发
    一键前端代理,一行命令开启nginx容器,代理前端页面
    go语言学习笔记
    patch需要数据格式前端算法,patch算法基础,两个对象对比取差异属性
    react-native中使用Echarts,自己使用WebView封装Echarts经验
    如何用js自己实现Animate运动函数
    vue中的表单异步校验方法封装
    Entity Framework6使用SQL Server Compact免安装部署
    WCF异常传播
    解决.net的堆碎片化带来的内存占用过大的问题
  • 原文地址:https://www.cnblogs.com/qwertWZ/p/4753616.html
Copyright © 2020-2023  润新知