#include <stdio.h> int main(int argc, char** argv) { printf(“Hello, GNU!n”); return 0; } |
dnl Process this file with Autoconf to produce a configure scrīpt. AC_INIT(hello.c) AM_INIT_AUTOMAKE(hello, 1.0) dnl Checks for programs. AC_PROG_CC dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_OUTPUT(Makefile) |
% aclocal % Autoconf % ls aclocal.m4 configure configure.in hello.c |
AUTOMAKE_OPTIONS= foreign bin_PROGRAMS= hello hello_SOURCES= hello.c |
% Automake --add-missing Automake: configure.in: installing `./install-sh'' Automake: configure.in: installing `./mkinstalldirs'' Automake: configure.in: installing `./missing'' |
% ./configure creating cache ./config.cache checking for a BSD /usr/bin/install -c 梦到吃葡萄checking whether build environment yes checking whether make ts ${MAKE}... yes checking for found checking for found checking for found checking for found checking for found checking gcc checking whether the C compiler (gcc ) yes checking whether the C compiler (gcc ) is no checking whether we are using yes checking whether gcc accepts -g... yes updating cache ./config.cache creating ./config.status creating Makefile $ ls Makefile aclocal.m4 config.status hello.c mkinstalldirs Makefile.am config.cache configure install-sh Makefile.in config.log configure.in missing |
% make gcc -DPACKAGE="hello" -DVERSION="1.0" -I. -I. -g -O2 -c hello.c gcc -g -O2 -o hello hello.o 你还可以试试 “make clean“,”make install“,”make dist“: [root@localhost hello]# make clean test -z "hello " || rm -f hello rm -f *.o core *.core [root@localhost hello]# make install gcc -DPACKAGE="hello" -DVERSION="1.0" -I. -I. -g -O2 -c hello.c gcc -g -O2 -o hello hello.o 小孩子气make[1]: Entering directory `/home/joe/devel/hello'' /bin/sh ./mkinstalldirs /usr/local/bin /usr/bin/install -c hello /usr/local/bin/hello make[1]: Nothing to be done for `install-data-am''. make[1]: Leaving directory `/home/joe/devel/hello'' [root@localhost hello]# make dist rm -rf hello-1.0 mkdir hello-1.0 chmod 777 hello-1.0 here=`cd . && pwd`; top_distdir=`cd hello-1.0 && pwd`; distdir=`cd hello-1.0 && pwd`; cd . && Automake --include-deps --build-dir=$here --srcdir-name=. --output-dir=$top_distdir --foreign Makefile chmod -R a+r hello-1.0 GZIP=--best gtar chozf hello-1. hello-1.0 rm -rf hello-1.0 |
本文发布于:2023-06-29 08:01:08,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/fan/82/1064975.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |