极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7360|回复: 3

请问在arduino下如何使用命令行来编译代码

[复制链接]
发表于 2012-5-10 12:51:06 | 显示全部楼层 |阅读模式
本帖最后由 loneress 于 2012-5-10 13:05 编辑

不知道在Arduino下是否提供命令行的方式编译代码的,如果可行的话就能够自已开发IDE了。

是指编译为hex文件。
回复

使用道具 举报

 楼主| 发表于 2012-5-10 14:32:25 | 显示全部楼层
查看了一下。是基于WinAVR编译的。但不知如何转为ccp文件的,还有部分头文件不知是如何成生成出的。


D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\pins_arduino.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\pins_arduino.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\WInterrupts.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WInterrupts.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\wiring.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\wiring_analog.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_analog.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\wiring_digital.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_digital.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\wiring_pulse.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_pulse.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\wiring_shift.c -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_shift.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\HardwareSerial.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\HardwareSerial.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\main.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\main.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\Print.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\Print.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\Tone.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\Tone.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\WMath.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WMath.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=22 -ID:\arduino-0023\hardware\arduino\cores\arduino D:\arduino-0023\hardware\arduino\cores\arduino\WString.cpp -oC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WString.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\pins_arduino.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WInterrupts.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_analog.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_digital.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_pulse.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\wiring_shift.c.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\HardwareSerial.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\main.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\Print.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\Tone.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WMath.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\WString.cpp.o
D:\arduino-0023\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega168 -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.elf C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\core.a -LC:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp -lm
D:\arduino-0023\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.elf C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.eep
D:\arduino-0023\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.elf C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build4381471240117865887.tmp\AnalogReadSerial.cpp.hex
Binary sketch size: 1978 bytes (of a 14336 byte maximum)
回复 支持 反对

使用道具 举报

发表于 2012-5-10 18:32:58 | 显示全部楼层
你可以在这里,下载到arduino的IDE源代码。。。。里面就有怎么编译的全套代码。

http://code.google.com/p/arduino/
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-6-10 07:43:30 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-5-5 18:15 , Processed in 0.040371 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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