automake之helloworld
(2022-08-17 22:35:48)
mkdir helloworld
cd helloworld
vi helloworld.c //写入helloworld程序
autoscan //生成autoscan.log和configure.scan
mv configure.scan configure.ac
vi configure.ac //修改AC_INIT(helloworld, 1.0,
huyao0107@gmail.com),加入AM_INIT_AUTOMAKE(helloworld),AC_OUTPUT(Makefile)
aclocal //生成aclocal.m4
autoconf //生成configure
autoheader //生成config.h.in
touch NEWS README Changelog AUTHORS
vi Makefile.am //写入AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=helloworld helloworld_SOURCES=helloworld.c
automake --add-missing //生成Makefile.in
./configure //根据Makefile.in生成Makefile
make
./helloworld