1 | # Raspberry Pi settings |
2 | CC = gcc --std=c11 |
3 | CCFLAGS = -Wall -Wextra -pedantic -O3 -g |
4 | SOURCES = $(shell find src/rpi -name '*.c') |
5 | OBJECTS = $(SOURCES:%.c=bin/%.o) |
6 | OUT = autoplow |
7 |
|
8 |
|
9 | # Arduino Settings |
10 | F_CPU = 16000000L |
11 | MCU = atmega328p |
12 | ARDUINO_CC = avr-gcc |
13 | ARDUINO_CXX = avr-g++ |
14 | ARDUINO_AR = avr-ar |
15 | ARDUINO_FLAGS = -c -g -Os -Wall -Wextra -pedantic -MMD -ffunction-sections -fdata-sections -mmcu=$(MCU) -DF_CPU=$(F_CPU) -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 |
16 | ARDUINO_CC_FLAGS = $(ARDUINO_FLAGS) |
17 | ARDUINO_CPP_FLAGS = $(ARDUINO_FLAGS) -fno-exceptions |
18 | ARDUINO_INCLUDE = "include/arduino/" |
19 | ARD1_SOURCES = $(shell find src/ard1 -name '*.c') |
20 | # ARD2_SOURCES = $(shell find src/ard2 -name '*.c') |
21 |
|
22 |
|
23 | .PHONY: all ard1-build ard1-upload |
24 |
|
25 | all: $(EXEC) $(OBJECTS) |
26 |
|
27 | $(EXEC): $(OBJECTS) |
28 | $(CC) $(CXXFLAGS) $(OBJECTS) -o $(OUT) |
29 |
|
30 | ard1-build: $(ARD1_SOURCES) |
31 | $(ARDUINO_CXX) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) $(ARD1_SOURCES) -o bin/$(ARD1_SOURCES:%.c=%.o) |
32 |
|