sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.
http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile
GNU Lesser General Public License v2.1
2.02k stars 448 forks source link

Source files inside internal folders #674

Closed eda1-fiunam closed 3 years ago

eda1-fiunam commented 3 years ago

Actually Arduino-Makefile doesn't handle source files inside folders. For example:

libraries/
  FreeRTOS/
    src/
      Portable/
        atmega328/port.c
        sam3x8e/port.c

Unfortunately this file structure cannot be avoided. Sometimes I will want to build a project for the UNO board (using a dedicated Makefile), and others for the Due board (with another Makefile).

Don't worry for the duplicates, let's focus just in a file inside a folder:

libraries/
  FreeRTOS/
    src/
      Portable/
        atmega328/port.c

How can I tell the Makefile to find and compile the port.c file? Any hint?

eda1-fiunam commented 3 years ago

Last night it didn't work, but today it does. I don't know how and why, so I must assume your wonderful project already handles sources inside folders.

Thank you for this amazing project!