请问在arduino下如何使用命令行来编译代码
本帖最后由 loneress 于 2012-5-10 13:05 编辑不知道在Arduino下是否提供命令行的方式编译代码的,如果可行的话就能够自已开发IDE了。
是指编译为hex文件。 查看了一下。是基于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)
你可以在这里,下载到arduino的IDE源代码。。。。里面就有怎么编译的全套代码。
http://code.google.com/p/arduino/ http://www.arduinodev.com/sketchuploader-arduino-sketch-uploading-utility/
这才是真正的解决方法。
页:
[1]