makefile文件是linux里面编译c/c++文件的配置工具,首先linux需要安装gcc编译器:
huangxudong@huangxudong-X456UR:~/cpp/makedemo$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
huangxudong@huangxudong-X456UR:~/cpp/makedemo$
因为是要自动生成Makefile文件,所以需要下载一个工具,automake
root@huangxudong-X456UR:/etc/init.d# sudo apt-get install automake
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
automake 已经是最新版 (1:1.15.1-3ubuntu2)。
automake 已设置为手动安装。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 15 个软件包未被升级。
root@huangxudong-X456UR:/etc/init.d#
cpp源文件:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello