Makefile für den arduino uno

Hallo ,
ich habe jetzt schon ein paar Programme für den arduino uno geschrieben und bin begeistert!! Nur Geany, meine Lieblings-IDE vermisse ich doch sehr (bzw einige nützliche Funktionen).
Also habe ich ein wenig gegoogelt und auch ein makefile gefunden.
Nur klappt da noch nicht so ganz:
Ich bekomme die Fehlermeldung

ls: Zugriff auf *.c nicht möglich: Datei oder Verzeichnis nicht gefunden
ls: Zugriff auf *.cpp nicht möglich: Datei oder Verzeichnis nicht gefunden
mkdir -p ./applet
/usr/bin/avr-g++ -c -g -Os -Wall -Wstrict-prototypes -fno-exceptions -ffunction-sections -fdata-sections -DF_CPU=16000000L -DARDUINO=18  -I /usr/lib/avr/include -I/home/dominik/arduino/arduino-0022/hardware/arduino/cores/arduino -I/home/dominik/arduino/make -I/home/dominik/arduino/make/applet -mmcu=atmega328p -x c++ make.pde -o applet/make.o
cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
make.pde: In function »void setup()«:
make.pde:15: Fehler: expected initializer before »pinMode«
make: *** [applet/make.o] Fehler 1

das Programm ist das hier:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

#include <WProgram.h>


void setup() {  
  
          
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT); 
      
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

Was mache ich denn da falsch? Das Makefile ist im Anhang zu finden, da es zu groß ist

Vielen Dank für die Hilfe
sherpa_de

makefile (11 KB)

Du koenntest auch Code::Blocks verwenden. Diese IDE ist um welten besser als der arduino text editor.

Ich habe mal 2 projekte zusammengebastelt: GitHub - madworm/Arduino---Code--Blocks: CODE: Compling the 'core.a' file for your architecture + compiling 'normal' code. This assumes you have a working avr-gcc, avr-libc and the avr-binutils installed! This is intended to run on linux.

a) core libs + wire
b) demo "main.cpp"

Vermutlich muesstest du noch in den build-optionen die suchpfade auf deine installation anpassen. Die anderen arduino bibliotheken koennte man da auch noch reinbauen, wozu mir aber im moment die zeit fehlt. Mit I2C und serial habe ich das bei mir getestet, scheint zu laufen.

Der build prozess laeft wie folgt:

  • cpu-target in den build optionen einstellen, core libs bauen lassen. nur 1x nach wechsel des targets.
  • main.cpp schreiben und bauen, verlinkt wird dann gegen 'core.a'