minimum c++ make file for linux

后端 未结 11 1868
眼角桃花
眼角桃花 2020-12-23 17:32

I\'ve looking to find a simple recommended \"minimal\" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not

11条回答
  •  太阳男子
    2020-12-23 17:53

    florin has a good starting point. I didn't like gnu autoconf so I started there and took the concept further and called it the MagicMakefile. I have 3 versions of it from simple to more complex. The latest is now on github: https://github.com/jdkoftinoff/magicmake

    Basically, it assumes you have a standard layout for the source files of your project and uses the wildcard function to create the makefile rules on the fly which are then eval'd, handling header file dependancies, cross compiling, unit tests, install, and packaging.

    [edit] At this point I use cmake for all my projects since it generates useful project files for many build systems.

    jeff koftinoff

提交回复
热议问题