-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
140 lines (94 loc) · 3.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
## Creator: Cameron Tacklind
##
## This is the main Makefile for building AVR projects. It should only be edited
## to add generic and project specific features. Ideally, there are no real targets
## here. Just variables, or overrides, that the included helper makefiles will use.
# List of C file basenames to build
cNames =
# List of CPP file basenames to build
cppNames = main Debug
cppNames += System/Board
cppNames += System/Clock
cppNames += AVR/Timer
cppNames += ThreePhase/Driver
cppNames += Sensors/MLX90363 ThreePhase/PositionEstimator ThreePhase/Controller
cppNames += ThreePhase/FaultTester
cppNames += ServoController
cppNames += Sensors/MLXDebug
cppNames += GenericImplementations/TripleBuffer-impl
cppNames += GenericImplementations/BlockBuffer-impl
cppNames += Routines/Demo
cppNames += Routines/Calibration
cppNames += Sensors/HallWatcher
cppNames += CalibrationData/LookupTable
cppNames += CalibrationData/idBlock
cppNames += Interface/Serial
cppNames += Interface/Interface
cppNames += Interface/USB/Interface
cppNames += Interface/USB/Descriptors
cNames += Interface/USB/Descriptors
#MotorID = Motor1
AVRpp_SRC = TimerTimeout USART gccGuard FlashCRC
cppNames += Sensors/ScanningADC-impl
libCameron_SRC = CRC8 DecPrintFormatter
# Select specific LUFA source files to compile like this
#LUFA_SRC = LUFA/Drivers/USB/Class/Common/HIDParser.c
F_CPU = 16000000UL
DEFINES = USE_LUFA_CONFIG_HEADER
# LUFA needs this with USE_LUFA_CONFIG_HEADER so that it can find LUFAConfig.h
INCLUDES = src
# Make compilation fail on first error
Build_Flags_Extra = -Wfatal-errors
TARGET = controller
MCU = atmega32u4
all: build-lss
# Program with AVR attached locally
all: dfu-flash dfu-reset
#ASM = $(CPP:%=%.cpp.S)
-include remote-config.mk
MAKEFILE_LIST := $(filter-out remote-config.mk,$(MAKEFILE_LIST))
# Load local settings
-include local.mk
-include local.$(shell hostname).mk
uMakerPath ?= uMaker/
Source_Path ?= src/
include $(uMakerPath)tools/paths.mk
# Generate list of source files from basenames
include $(uMakerPath)tools/source.mk
# Force setting certain make flags
include $(uMakerPath)tools/makeflags.mk
# Optional configuration testing for development
include $(uMakerPath)tools/checks.mk
# Defs for our setup
include $(uMakerPath)vars/AVR.mk
# Library targets
include $(uMakerPath)tools/AVR/lufa.mk
#include $(uMakerPath)tools/extlib.mk
include $(uMakerPath)tools/AVR/AVR++.mk
include $(uMakerPath)tools/libCameron.mk
# Build targets
include $(uMakerPath)tools/build.mk
# Intermediate assembly
include $(uMakerPath)tools/assembly.mk
# Programmer targets
include $(uMakerPath)tools/dfu.mk
#include $(uMakerPath)tools/nrfjprog.mk
#include $(uMakerPath)tools/AVR/avrdude.mk
# Directory creation targets
include $(uMakerPath)tools/mkdir.mk
REMOTE_HEX = $(TARGET).hex
REMOTE?=sleepypi-04
remote: $(OUT_HEX)
$(ECO) Sending $(OUT_HEX) to $(REMOTE)
pscp -q $(OUT_HEX) $(REMOTE):$(REMOTE_HEX)
-plink -batch $(REMOTE) sudo $(DFU_TARGETED) flash $(REMOTE_HEX) \&\& sudo $(DFU_TARGETED) reset
plink -batch $(REMOTE) rm $(REMOTE_HEX)
remote4: $(OUT_HEX)
$(ECO) Sending $(OUT_HEX) to $(REMOTE)
pscp -q $(OUT_HEX) $(REMOTE):$(REMOTE_HEX)
-plink -batch $(REMOTE) sudo $(DFU_TARGETED) flash $(REMOTE_HEX) \&\& sudo $(DFU_TARGETED) reset
-plink -batch $(REMOTE) sudo $(DFU_TARGETED) flash $(REMOTE_HEX) \&\& sudo $(DFU_TARGETED) reset
-plink -batch $(REMOTE) sudo $(DFU_TARGETED) flash $(REMOTE_HEX) \&\& sudo $(DFU_TARGETED) reset
-plink -batch $(REMOTE) sudo $(DFU_TARGETED) flash $(REMOTE_HEX) \&\& sudo $(DFU_TARGETED) reset
plink -batch $(REMOTE) rm $(REMOTE_HEX)
.PHONY: all run remote_prog remote remote4