Makefile that compiles all cpp files in a directory into separate executable

前端 未结 4 1246
不知归路
不知归路 2021-02-09 01:12

I am now studying C++. I want a makefile which will compile all of the cpp files in the current directory to separate executables. For example:

4条回答
  •  天涯浪人
    2021-02-09 01:49

    The simplest makefile you can create that might work for you is this:

    all: examp1.exe examp2.exe examp3.exe
    

    That will use make's default rules to create your three programs.

提交回复
热议问题