Index

auto-plow / ea27a3d

A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
930 Nov 2018 19:44ea27a3dUpdate Makefile for Arduino compilationJoshua1589N

Blob @ auto-plow / Makefile

text/plain4859 bytesdownload raw
1# Raspberry Pi settings
2CC = gcc --std=c11
3CCFLAGS = -Wall -Wextra -pedantic -O3 -g
4SOURCES = $(shell find src/rpi -name '*.c')
5OBJECTS = $(SOURCES:%.c=%.o)
6OUT = autoplow
7
8
9# Arduino Settings
10F_CPU = 16000000L
11MCU = atmega328p
12ARDUINO_CC = avr-gcc
13ARDUINO_CXX = avr-g++
14ARDUINO_AR = avr-ar
15OBJ_COPY = avr-objcopy
16ARDUINO_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
17ARDUINO_CC_FLAGS = $(ARDUINO_FLAGS)
18ARDUINO_CXX_FLAGS = $(ARDUINO_FLAGS) -fno-exceptions
19ARDUINO_INCLUDE = "include/arduino/"
20ARD1_SOURCES = $(shell find src/ard1 -name '*.cpp')
21ARD1_OUT = bin/ard1.hex
22# ARD2_SOURCES = $(shell find src/ard2 -name '*.cpp')
23
24
25.PHONY: all ard1-build ard1-upload
26
27all: $(OUT) $(OBJECTS)
28
29$(OUT): $(OBJECTS)
30 $(CC) $(CCFLAGS) $(OBJECTS) -o $(OUT)
31
32ard1-build: $(ARD1_OUT) $(ARD1_SOURCES)
33
34$(ARD1_OUT): $(ARD1_SOURCES)
35 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) $(ARD1_SOURCES) -o $(ARD1_SOURCES:%.cpp=%.o)
36 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}abi.cpp -o $(ARDUINO_INCLUDE)abi.o
37 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}CDC.cpp -o $(ARDUINO_INCLUDE)CDC.o
38 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}HardwareSerial.cpp -o $(ARDUINO_INCLUDE)HardwareSerial.o
39 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}HardwareSerial0.cpp -o $(ARDUINO_INCLUDE)HardwareSerial0.o
40 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}HardwareSerial1.cpp -o $(ARDUINO_INCLUDE)HardwareSerial1.o
41 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}HardwareSerial2.cpp -o $(ARDUINO_INCLUDE)HardwareSerial2.o
42 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}HardwareSerial3.cpp -o $(ARDUINO_INCLUDE)HardwareSerial3.o
43 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}IPAddress.cpp -o $(ARDUINO_INCLUDE)IPAddress.o
44 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}main.cpp -o $(ARDUINO_INCLUDE)main.o
45 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}new.cpp -o $(ARDUINO_INCLUDE)new.o
46 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}PluggableUSB.cpp -o $(ARDUINO_INCLUDE)PluggableUSB.o
47 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}Print.cpp -o $(ARDUINO_INCLUDE)Print.o
48 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}Stream.cpp -o $(ARDUINO_INCLUDE)Stream.o
49 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}Tone.cpp -o $(ARDUINO_INCLUDE)Tone.o
50 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}USBCore.cpp -o $(ARDUINO_INCLUDE)USBCore.o
51 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}WMath.cpp -o $(ARDUINO_INCLUDE)WMath.o
52 $(ARDUINO_CXX) $(ARDUINO_CXX_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}WString.cpp -o $(ARDUINO_INCLUDE)WString.o
53 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}hooks.c -o $(ARDUINO_INCLUDE)hooks.o
54 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}WInterrupts.c -o $(ARDUINO_INCLUDE)WInterrupts.o
55 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}wiring.c -o $(ARDUINO_INCLUDE)wiring.o
56 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}wiring_analog.c -o $(ARDUINO_INCLUDE)wiring_analog.o
57 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}wiring_digital.c -o $(ARDUINO_INCLUDE)wiring_digital.o
58 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}wiring_pulse.c -o $(ARDUINO_INCLUDE)wiring_pulse.o
59 $(ARDUINO_CC) $(ARDUINO_CC_FLAGS) -I$(ARDUINO_INCLUDE) ${ARDUINO_INCLUDE}wiring_shift.c -o $(ARDUINO_INCLUDE)wiring_shift.o
60 $(AR) rcs core.a WInterrupts.c.o
61 $(AR) rcs core.a wiring.c.o
62 $(AR) rcs core.a wiring_analog.c.o
63 $(AR) rcs core.a wiring_digital.c.o
64 $(AR) rcs core.a wiring_pulse.c.o
65 $(AR) rcs core.a wiring_shift.c.o
66 $(AR) rcs core.a CDC.cpp.o
67 $(AR) rcs core.a HardwareSerial.cpp.o
68 $(AR) rcs core.a HID.cpp.o
69 $(AR) rcs core.a IPAddress.cpp.o
70 $(AR) rcs core.a main.cpp.o
71 $(AR) rcs core.a new.cpp.o
72 $(AR) rcs core.a Print.cpp.o
73 $(AR) rcs core.a Stream.cpp.o
74 $(AR) rcs core.a Tone.cpp.o
75 $(AR) rcs core.a USBCore.cpp.o
76 $(AR) rcs core.a WMath.cpp.o
77 $(AR) rcs core.a WString.cpp.o
78 $(ARDUINO_CC) -Os -Wl,--gc-sections -mmcu=$(MCU) -o $(ARD1_SOURCES).elf $(ARD1_SOURCES).o core.a -lm
79 $(OBJ_COPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(ARD1_SOURCES).elf $(ARD1_SOURCES).eep
80 $(OBJ_COPY) -O ihex -R .eeprom $(ARD1_SOURCES).elf $(ARD1_OUT).hex
81