Chinaunix首页 | 论坛 | 博客
  • 博客访问: 607040
  • 博文数量: 353
  • 博客积分: 1104
  • 博客等级: 少尉
  • 技术积分: 1457
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-23 23:02
个人简介

1、刚工作时做Linux 流控;后来做安全操作系统;再后来做操作系统加固;现在做TCP 加速。唉!没离开过类Unix!!!但是水平有限。。

文章存档

2015年(80)

2013年(4)

2012年(90)

2011年(177)

2010年(1)

2009年(1)

分类:

2011-09-10 15:11:58

# 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/

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