正好今天要使用automake来生成makefile,在此做个记录。
目前在同一个文件夹下有如下几个c++文件
下面一步一步的生成makefile文件
首先执行 :
ubuntu@VM-145-227-ubuntu:~/work/bbb/EcMasterDemoSyncSm$ autoscan
执行该命令后,会根据我的源码生成configure.scan文件,然后修改或者拷贝成configure.ac文件,大致过程如下:
your source files –> [autoscan*] –> [configure.scan] –> configure.ac
这里该需要对configure.ac做一下修改:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT(acontiethercat, [1.0], [])
AM_INIT_AUTOMAKE(acontiethercat,1.0)
AC_CONFIG_SRCDIR([SyncSmDemoMain.cpp])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX(arm-linux