Chinaunix首页 | 论坛 | 博客
  • 博客访问: 340867
  • 博文数量: 10
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 606
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-16 20:16
文章分类

全部博文(10)

文章存档

2011年(1)

2009年(8)

2008年(1)

我的朋友

分类: LINUX

2008-06-24 14:31:33

在test目录上新建src和include目录,源文件中src目录下,头文件在include目录。在src目录新建Makefile.am文件,编写Makefile.am,如下:
AUTOMAKE_OPTIONS = foreign
INCLUDES= -I../include
bin_PROGRAMS = main
radio_SOURCES = main.c \
keyboard.c \
lcd.c \
setup.c \
storage.c
 
保存退出。
返回test目录,再新建Makefile.am文件,编写Makefile.am,如下:
SUBDIRS = src
保存退出。
 
执行 
autoscan
生成configure.scan文件 ,如:
autoscan.log  configure.scan  include  Makefile.am  src
编辑configure.scan文件,如:
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(radio,1.0.0,[wenzel@163.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/make.c])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
#AC_PROG_RANLIB
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([bzero memset strcasecmp strchr strrchr])
#AC_CONFIG_FILES([Makefile
#                 src/Makefile])
AC_OUTPUT(Makefile src/Makefile)
 
保存退出,改名为:mv configure.scan configure.in
执行:
touch NEWS README AUTHORS ChangeLog
再执行:
autoreconf -fvi
 
最后,可以执行:
./configure
配置为ARM平台:
 ./configure --host=arm --target=arm CC=arm-linux-gcc
就可以编译了,如:
make 
make install
make clean
make distclean
 
 
---------------------------------------
阅读(1521) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

wpneu2008-06-28 01:07:38

学习了