使用automake生成静态库
来源:互联网 发布:淘宝店铺外包有用吗 编辑:程序博客网 时间:2024/05/17 02:31
一. 主函数Makefile创建
1. autoscan->生成 configure.scan 和 autoscan.log
2.将configure.scan 修改为 configure.in:
并修改configure.in内容如下
# Process this file with autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)
# Checks for programs.
AC_PROG_CC
# Checks for library functions.
AC_OUTPUT(Makefile)
3. aclocal
->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)
4. autoconf
->生成 configure (根据 configure.in, 和 aclocal.m4)
5. autoheader
->生成 config.h.in 宏定义
6. 编写Makefile.am
AUTOMAKE_OPTIONS=foreign
INCLUDES=-I../include
bin_PROGRAMS=hello
hello_SOURCES=hello.c
hello_LDADD=../lib/libhello.a
7. touch NEWS AUTHORS README ChangeLog
8. automake --add-missing
->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)
9. ./configure
->生成 Makefile, config.log, 和 config.status
10. make
二. 静态库Makefile创建
1. configure.in创建
# configure.in
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(libhello.a,1.1,[])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
AC_PROG_RANLIB//需要加入的内容,因为使用了静态库
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT([Makefile])
AC_INIT(FILE)
#Makefile.am
AUTOMAKE_OPTIONS=foreign
noinst_LIBRARIES=libhello.a
libhello_a_SOURCES=test.c
1. autoscan->生成 configure.scan 和 autoscan.log
2.将configure.scan 修改为 configure.in:
并修改configure.in内容如下
# Process this file with autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)
# Checks for programs.
AC_PROG_CC
# Checks for library functions.
AC_OUTPUT(Makefile)
3. aclocal
->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)
4. autoconf
->生成 configure (根据 configure.in, 和 aclocal.m4)
5. autoheader
->生成 config.h.in 宏定义
6. 编写Makefile.am
AUTOMAKE_OPTIONS=foreign
INCLUDES=-I../include
bin_PROGRAMS=hello
hello_SOURCES=hello.c
hello_LDADD=../lib/libhello.a
7. touch NEWS AUTHORS README ChangeLog
8. automake --add-missing
->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)
9. ./configure
->生成 Makefile, config.log, 和 config.status
10. make
二. 静态库Makefile创建
1. configure.in创建
# configure.in
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(libhello.a,1.1,[])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
AC_PROG_RANLIB//需要加入的内容,因为使用了静态库
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT([Makefile])
AC_INIT(FILE)
#Makefile.am
AUTOMAKE_OPTIONS=foreign
noinst_LIBRARIES=libhello.a
libhello_a_SOURCES=test.c
0 0
- 使用automake生成静态库
- automake生成静态链接库
- automake生成静态链接库
- automake生成静态链接库
- 使用Automake 创建和使用静态库
- 使用Automake生成Makefile及动态库和静态库的创建
- 使用Automake生成Makefile
- automake同时生成静态链接库和动态链接库
- automake同时生成静态链接库和动态链接库
- automake同时生成静态链接库和动态链接库
- automake创建静态库
- 使用Automake 创建和使用静态库/动态库
- 使用Automake 创建和使用静态库 转
- automake 生成动态链接库 - automake&Makefile
- 【转帖】使用Automake生成Makefile
- 使用AutoMake轻松生成Makefile
- 使用AutoMake轻松生成Makefile
- 使用Automake,Autoconf生成Makefile
- 树链剖分
- **LeetCode 24. Swap Nodes in Pairs
- LeetCode Contains Duplicate II(hash)
- HDU 1086.You can Solve a Geometry Problem too【判断两线段相交】【数学题】【12月30】
- 看看下边的问题你能够回答出来多少?
- 使用automake生成静态库
- 太上感应篇0014
- 【跟我学spring 4.0 】之第八节-Spring 表达式语言(Spring EL)
- 正规军与土八路的较量(抽象类与接口比较分析)
- iOS常用的第三方框架
- 《HTTP权威指南》学习笔记-HTTP概述和URL
- 3.库(资源包)
- 关于java学习一位好友给的建议
- [1]姥爷幽默谈Objective-C(Objective-C起源,对象,类,方法)