如何写Makefile编译汇编和C文件
有些场景下编译的程序是不能依赖OS和标准的C库的,并且需要C和汇编混合编译,如bootloader程序,就需要制定参数-nostdlib,这样的Makefile如下所示:
all:
arm-linux-gcc -O2 -Wall -nostdlib -march=armv4 -Wl,-T,ipl.lds uart.c ipl.c nfc.c nand.c sha1.c arm.s -o ipl.exe
arm-linux-objcopy -Obinary ipl.exe ipl.bin
clean:
rm -rf ipl.exe ipl.bin
相关推荐
xushxbigbear微信 2020-05-16
jeonkc 2020-04-19
mikesno 2020-02-23
hazing 2020-02-22
hbcbgcx 2011-03-24
wanggongzhen 2020-05-28
hongsheyoumo 2020-05-01
yoshubom 2020-07-18
Plant 2020-06-07
hazing 2020-05-01
choupiaoyi 2020-01-23
83096129 2020-01-17
Joymine 2020-01-03
christinzhm 2010-09-13
downtown 2010-09-13
Will0 2011-03-15
ITlover00 2011-03-13
zhonglinzhang 2011-02-28
我叫河蟹 2011-02-13