jjvip136 发表于 2013-4-15 11:35:14

自动生成Makefile的工具autotool-automake请教了!

看了两三天,还没弄好这个autotool真是郁闷。
目前的情况是知道了这个autotool生成Makefile的流程,试普通的例子都能行得通,但是现在要链接成arm能用的,就是不行。真是
走投无路了。.


之前已经成功的生成的Makefile

现在编译也能通过,

$CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux      

此时虚拟机上已经有有arm-linux-gcc系统的编译工具


然后是make,就出这些错误了。。。。。。。。:::


# CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... arm-linux-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-gcc... arm-linux-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 arm-linux-gcc accepts -g... yes
checking for arm-linux-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of arm-linux-gcc... gcc3
checking dependency style of arm-linux-gcc... gcc3
checking for arm-linux-ranlib... arm-linux-ranlib
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating inc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
# make
makeall-recursive
make: 进入目录“/share2win/project/uart_ask”
Making all in inc
make: 进入目录“/share2win/project/uart_ask/inc”
make: 对“all”无需做任何事。
make: 离开目录“/share2win/project/uart_ask/inc”
make: 进入目录“/share2win/project/uart_ask”
arm-linux-gcc -DHAVE_CONFIG_H -I. -I /share2win/project/uart_ask    -Wall -g -MT uart.o -MD -MP -MF .deps/uart.Tpo -c -o uart.o uart.c
uart.c:1:18: fatal error: regs.h: No such file or directory
compilation terminated.
make: *** 错误 1
make: 离开目录“/share2win/project/uart_ask”
make: *** 错误 1
make: 离开目录“/share2win/project/uart_ask”
make: *** 错误 2
#





真心求指导~~~~

jjvip136 发表于 2013-4-15 12:15:40

顶起啊,没有具体解决办法,也可以提提意见嘛

abnerle 发表于 2013-4-15 15:27:23

CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux    && make

jjvip136 发表于 2013-4-15 16:38:40

abnerle 发表于 2013-4-15 15:27 static/image/common/back.gif
CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux    && make

就是make后才有一堆错误,。Makefile是生成了 的

abnerle 发表于 2013-4-15 16:43:23

jjvip136 发表于 2013-4-15 16:38 static/image/common/back.gif
就是make后才有一堆错误,。Makefile是生成了 的

makefile应该还是有问题,才提示对all没有规则可执行

Privia 发表于 2013-4-15 17:13:27

原来还有自动生成makefile的工具啊,我是新手,长见识了,回去玩下看 {:lol:}{:lol:}

笑笑我笑了 发表于 2013-4-15 17:18:04

CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux 加到Makefile里面去啊.最好把Makefile发上来看看吧.

jjvip136 发表于 2013-4-15 17:56:15

笑笑我笑了 发表于 2013-4-15 17:18 static/image/common/back.gif
CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux 加到Makefile里面去啊.最好把 ...

好~~~整个都搞上来了,欢迎大家指导 

笑笑我笑了 发表于 2013-4-15 18:03:51

jjvip136 发表于 2013-4-15 17:56 static/image/common/back.gif
好~~~整个都搞上来了,欢迎大家指导 

总共要编译的文件就那么几个啊.建议自己吧.或者用下面这个改一下吧,这个是用来编译STM32F3的# put your *.o targets here, make should handle the rest!
SRCS = main.c stm32f30x_it.c system_stm32f30x.c

# all the files will be generated with this name (main.elf, main.bin, main.hex, etc)

PROJ_NAME=main

# that's it, no need to change anything below this line!

###################################################

export CC=arm-none-eabi-gcc
export LD=arm-none-eabi-gcc
export AR=arm-none-eabi-ar
export AS=arm-none-eabi-as
export OBJCOPY=arm-none-eabi-objcopy
export RANLIB=arm-none-eabi-ranlib

export LDFLAGS=-Wl,-T,stm32f30_flash.ld -L../FWLib -lstm32f3
#export CFLAGS=-g -O1 -c -nostdlib -fno-common
#CFLAGS += -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mthumb-interwork -mlittle-endian -mfpu=fpv4-sp-d16
#CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DMANGUSTA_DISCOVERY -DHSE_VALUE=8000000
export CFLAGS=-g -O2
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
CFLAGS += -ffreestanding -nostdlib
CFLAGS += -DSTM32F30X

#CWD = $(shell pwd)
#export ROOT=$(CWD)
#export LIB_ROOT=$(ROOT)/lib

###################################################

vpath %.c ../FWLib/src

CFLAGS += -I../FWLib/inc -I../CMSIS/Include
CFLAGS += -I../USER -I../CMSIS/Device/ST/STM32F30x/Include

SRCS += ../STARTCODE/startup_stm32f30x.s # add startup file to build

OBJS = $(SRCS:.c=.o)

###################################################

.PHONY: proj

all:         proj


lib:
        $(MAKE) -C lib

proj:         $(PROJ_NAME).elf

$(PROJ_NAME).elf: $(SRCS)
        $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
#        $(LD) $(LDFLAGS) --verbose -o $@ $(OBJS) -lstm32f4
        $(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
        $(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin

clean:
        rm -f *.o
        rm -f $(PROJ_NAME).elf
        rm -f $(PROJ_NAME).hex
        rm -f $(PROJ_NAME).bin

abnerle 发表于 2013-4-15 18:04:48

这么简单的东西没有必要configure吧,直接写个makefile就行了

jjvip136 发表于 2013-4-15 18:27:47

笑笑我笑了 发表于 2013-4-15 18:03 static/image/common/back.gif
总共要编译的文件就那么几个啊.建议自己吧.或者用下面这个改一下吧,这个是用来编译STM32F3的 ...

好吧。精力不集中在这里了,纯浪费时间,按你说的去搞

jjvip136 发表于 2013-4-15 18:28:12

abnerle 发表于 2013-4-15 18:04 static/image/common/back.gif
这么简单的东西没有必要configure吧,直接写个makefile就行了

自己也可以写出来,主要是有点牛角尖了,想搞明白这鸟东东
页: [1]
查看完整版本: 自动生成Makefile的工具autotool-automake请教了!