首页 > 代码库 > automake

automake

./configure --prefix="/root/code/install/x86" CPPFLAGS="-I/root/src/include"  LDFLAGS="-L/usr/local/lib -L/root/code/x86/sqlite"

 

动态链接

AUTOMAKE_OPTIONS=foreignSUBDIRS=face cgibin_PROGRAMS=main main_SOURCES=main.cppmain_LDADD=face/libface.a -lopencv_video -lopencv_videostab -lrt -lpthread -lm -ldl  

  

静态库

AUTOMAKE_OPTIONS=foreignnoinst_LIBRARIES=libface.a libface_a_SOURCES=face.h face.cpp

  

 

静态链接

AUTOMAKE_OPTIONS=foreignbin_PROGRAMS=hello.cgi 
INCLUDES= -I../include/sqlitehello_cgi_SOURCES=hello.cpp hello_cgi_LDADD= -lsqlite3 -lpthread -ldlhello_cgi_LDFLAGS=-static

  

 

 

 

说明:

文件类型书写格式
可执行文件bin_PROGRAMS = foo
foo_SOURCES = xxxx.c
foo_LDADD = libfoolib.a
foo_LDFLAGS =
foo_DEPENDENCIES =
静态库lib_LIBRARIES = libfoo.a
foo_a_SOURCES =
foo_a_LDADD =
foo_a_LIBADD =
foo_a_LDFALGS =
头文件include_HEADERS = foo.h
数据文件data_DATA = data1 data2

 

如果只想编译,而不想安装到系统中,就用 noinst_LIBRARIES 代替 bin_LIBRARIES ,对于可执行文件就用 noinst_PROGRAMS 代替 bin_PROGRAMS

 

还可以在Makefile.am添加编译参数AM_CPPFLAGS和AM_LDFLAGS

 

比如64位linux编译32位程序可以加入下面参数:

 

AM_CPPFLAGS = -m32
AM_LDFLAGS = -m32 -melf_32

automake