Chinaunix首页 | 论坛 | 博客
  • 博客访问: 789605
  • 博文数量: 130
  • 博客积分: 3477
  • 博客等级: 中校
  • 技术积分: 1339
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-30 21:53
文章分类

全部博文(130)

文章存档

2024年(1)

2023年(10)

2022年(4)

2021年(10)

2020年(9)

2018年(1)

2017年(1)

2014年(4)

2013年(3)

2012年(12)

2011年(24)

2010年(2)

2009年(8)

2008年(6)

2007年(34)

2006年(1)

分类: C/C++

2008-06-29 18:21:47

在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
阅读(1516) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~