天嵌 ARM开发社区

 找回密码
 注册
查看: 3361|回复: 1

TQ2440_test测试程序(其实就是裸机程序)如何编译

[复制链接]
newman0708 发表于 2013-1-31 12:25:09 | 显示全部楼层 |阅读模式
TQ2440_test测试程序(其实就是裸机程序),在windows上可能用ADS1.2编译通过。
我用的是linux系统,所以想问一下如何用arm-linux-gcc来编译,
能不能给个Makefile(通用些的)。

我的[Makefile]文件
CFLAGS         := -Wall -Wstrict-prototypes -g -fomit-frame-pointer -ffreestanding

## Include Directories
INCLUDES = -I"../inc/"

PROJECT=Main
PROJECTBIN   = $(PROJECT).bin

CC=arm-linux-gcc $(INCLUDES)
COMPILE.C = $(CC) $(CFLAGS) -c
COMPILE.S = $(CC) -S -Wall -O2 -c
OBJ   = 2440init.o 2440slib.o $(PROJECT).o camif.o IrDA.o memtest.o RTC.o UDA1341.o 2440lib.o camproset.o keyscan.o mmu.o SD_MMC.o dma.o LCD_TFT.o nand.o Test_OV9650.o Adc.o  eeprom.o  Main.o Pic.o Touchpanel.o AudioDrv.o IIC.o  profile.o TQ_LOGO.o

all: $(PROJECT)

$(PROJECT) : $(OBJ)
        arm-linux-ld -T$(PROJECT).lds $(OBJ) -o $(PROJECT)_elf
        arm-linux-objcopy -O binary -S $(PROJECT)_elf $(PROJECT).bin
        arm-linux-objdump -D -m arm  $(PROJECT)_elf > $(PROJECT).dis

%.o: %.s
        $(COMPILE.S) $< -o $@

%.o: %.c
        $(COMPILE.C) $< -o $@


clean:
        rm -f   $(PROJECT).dis $(PROJECT).bin $(PROJECT)_elf *.o





我在Makefile在src目录里
newman0708@debian:/work/eclipse_projects/TQ2440_Test/src$ ls
2440init.s  camproset.c  LCD_TFT.c     mmu.o      RTC.o          TQ_LOGO.o
2440lib.c   dma.c        Main.c        nand.c     SD_MMC.c       UDA1341.c
2440slib.s  dma.o        Makefile      nand.o     SD_MMC.o       UDA1341.o
Adc.c       eeprom.c     Makefile.tgz  Pic.c      Test_OV9650.c
Adc.o       IIC.c        memtest.c     Pic.o      Test_OV9650.o
AudioDrv.c  IrDA.c       memtest.o     profile.c  Touchpanel.c
camif.c     keyscan.c    mmu.c         RTC.c      TQ_LOGO.c

newman0708@debian:/work/eclipse_projects/TQ2440_Test/src$ make
arm-linux-gcc -I"../inc/"  -S -Wall -O2 -c 2440init.s -o 2440init.o
arm-linux-gcc -I"../inc/"  -S -Wall -O2 -c 2440slib.s -o 2440slib.o
arm-linux-gcc -I"../inc/"  -S -Wall -O2 -c Main.c -o Main.o
In file included from Main.c:11:
../inc/2440addr.h: In function `ClearPending':
../inc/2440addr.h:677: warning: type defaults to `int' in declaration of `i'
../inc/2440addr.h: In function `ClearSubPending':
../inc/2440addr.h:685: warning: type defaults to `int' in declaration of `i'
In file included from Main.c:12:
../inc/2440lib.h:27:1: warning: "NULL" redefined
In file included from /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/string.h:33,
                 from Main.c:8:
/work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/include/stddef.h:402:1: warning: this is the location of the previous definition
Main.c: At top level:
Main.c:18: error: stray '$' in program
Main.c:18: error: stray '$' in program
Main.c:18: error: syntax error before "RO"
Main.c:18: error: stray '$' in program
Main.c:18: error: stray '$' in program
Main.c:18: warning: type defaults to `int' in declaration of `Limit'
Main.c:18: warning: data definition has no type or storage class
Main.c:19: error: stray '$' in program
Main.c:19: error: stray '$' in program
Main.c:19: error: syntax error before "RO"
Main.c:19: error: stray '$' in program
Main.c:19: error: stray '$' in program
Main.c:19: warning: type defaults to `int' in declaration of `Base'
Main.c:19: warning: data definition has no type or storage class
Main.c:20: error: stray '$' in program
Main.c:20: error: stray '$' in program
Main.c:20: error: syntax error before "RW"
Main.c:20: error: stray '$' in program
Main.c:20: error: stray '$' in program
Main.c:20: warning: type defaults to `int' in declaration of `Limit'
Main.c:20: warning: data definition has no type or storage class
Main.c:21: error: stray '$' in program
Main.c:21: error: stray '$' in program
Main.c:21: error: syntax error before "RW"
Main.c:21: error: stray '$' in program
Main.c:21: error: stray '$' in program
Main.c:21: warning: type defaults to `int' in declaration of `Base'
Main.c:21: warning: data definition has no type or storage class
Main.c:22: error: stray '$' in program
Main.c:22: error: stray '$' in program
Main.c:22: error: syntax error before "ZI"
Main.c:22: error: stray '$' in program
Main.c:22: error: stray '$' in program
Main.c:22: warning: type defaults to `int' in declaration of `Limit'
Main.c:22: warning: data definition has no type or storage class
Main.c:23: error: stray '$' in program
Main.c:23: error: stray '$' in program
Main.c:23: error: syntax error before "ZI"
Main.c:23: error: stray '$' in program
Main.c:23: error: stray '$' in program
Main.c:23: warning: type defaults to `int' in declaration of `Base'
Main.c:23: warning: data definition has no type or storage class
Main.c:67: error: stray '$' in program
Main.c:67: error: stray '$' in program
Main.c:67: error: syntax error before "RW"
Main.c:67: error: stray '$' in program
Main.c:67: error: stray '$' in program
Main.c:67: warning: type defaults to `int' in declaration of `Limit'
Main.c:67: warning: data definition has no type or storage class
Main.c:68: error: stray '$' in program
Main.c:68: error: stray '$' in program
Main.c:68: error: `Image' undeclared here (not in a function)
Main.c:68: error: syntax error before "RW"
Main.c:68: error: stray '$' in program
Main.c:68: error: stray '$' in program
Main.c: In function `Clk0_Enable':
Main.c:312: warning: suggest parentheses around arithmetic in operand of |
Main.c:313: warning: suggest parentheses around arithmetic in operand of |
Main.c: In function `Clk1_Enable':
Main.c:317: warning: suggest parentheses around arithmetic in operand of |
Main.c:318: warning: suggest parentheses around arithmetic in operand of |
Main.c: At top level:
Main.c:67: warning: array 'Limit' assumed to have one element
Main.c:23: warning: array 'Base' assumed to have one element
make: *** [Main.o] Error 1

报了很多错,不知道如何解决,请高手帮忙看一下。

embedsky_lhh 发表于 2013-1-31 14:47:15 | 显示全部楼层
这个你要改的东西多了,最好搞个LDS文件建立链接关系
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-6-3 06:58 , Processed in 1.046875 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表