Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2243726
  • 博文数量: 230
  • 博客积分: 9346
  • 博客等级: 中将
  • 技术积分: 3418
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-26 01:58
文章分类

全部博文(230)

文章存档

2015年(30)

2014年(7)

2013年(12)

2012年(2)

2011年(3)

2010年(42)

2009年(9)

2008年(15)

2007年(74)

2006年(36)

分类: LINUX

2010-06-22 15:35:25

# vi Makefile.am
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src

# vi src/Makefile.am
bin_PROGRAMS = platinum
platinum_SOURCES = platinum.c
platinum_LDADD = -lpthread

# autoscan
# mv configure.scan configure.in
# vi configure.in(添加 AM_INIT_AUTOMAKE)
# autoreconf -i

测试:

# ./configure --host=x86_64-pc-linux-gnu(使用交叉编译)

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-pc-linux-gnu-strip... x86_64-pc-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of x86_64-pc-linux-gnu-gcc... gcc3
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands


# make
make  all-am
make[1]: Entering directory `/tmp/platinum'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT platinum.o -MD -MP -MF .deps/platinum.Tpo -c -o platinum.o platinum.c
mv -f .deps/platinum.Tpo .deps/platinum.Po
x86_64-pc-linux-gnu-gcc  -g -O2   -o platinum platinum.o 
make[1]: Leaving directory `/tmp/platinum'

# /usr/share/libtool/config/config.guess
i686-pc-linux-gnu

# file src/platinum
platinum: ELF 64-bit LSB executable,x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped


相关链接:

http://www.ibm.com/developerworks/cn/linux/l-makefile/

阅读(5416) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~