-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (50 loc) · 2.3 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
# Template makefile for arduino-ua toolchain
# Version 2.0 - 2012-11-07
# Remember to `make clean` before `make upload to a different board type
# Actually, when you resume development its a good idea to start with a
# make clean.
# This is needed only if you have a main .ino file from a use of the IDE.
# Normally you will only have .cpp files.
TARGET = client_soln
# Two common board types, mega2560 and uno.
# Either set your board type here or supply it on the make command as in
# `make upload BOARD_TAG=uno`
BOARD_TAG = mega2560
# Identify and of the extra libraries that are not in the core collection
# here. If you don't have any, leave it undefined.
# For example:
# ARDUINO_LIBS = SPI Adafruit_GFX Adafruit_ST7735 \
# Adafruit_SD Adafruit_SD/utility SD/utility UAUtils_Memory
ARDUINO_LIBS = UAUtils Adafruit_GFX Adafruit_ST7735 SD SD/utility SPI SD_Images \
UAUtils_Memory UAUtils_lcd
# if there is a ARDUINO_UA_ROOT environment variable, it defines the
# root of the arduino_ua install. If not, we assume it is $(HOME)
ifndef ARDUINO_UA_ROOT
ARDUINO_UA_ROOT=$(HOME)
endif
# now set up all the toolchain defaults for the arduino-us install
include $(ARDUINO_UA_ROOT)/arduino-ua/mkfiles/ArduinoUA.mk
# This is magic to define the names MEGA or UNO in C/C++ files. on the
# basis of the board type.
BOARD_DEFINE := $(shell echo $(BOARD_TAG) | tr 'a-z' 'A-Z' | tr -d [0-9])
# You can also add extra symbols to be defined, like DEBUG
DEFINITIONS = $(BOARD_DEFINE)
# this puts the -D arguments into the format rquired by the compiler.
DEFINES := ${DEFINITIONS:%=-D%}
# Define your compiler flags. Remember to `+=` the rule.
#CFLAGS += -Wall -Werror -std=c99
#CXXFLAGS += -Wall -Werror
CPPFLAGS += $(DEFINES)
# Override the default optimization levels here
# For example, set to optimize level 0 to get the mimimum amount
# CPP_OPTIMIZE = -O0
# C_OPTIMIZE = -O0
# LD_OPTIMIZE = -O0
# Sometimes it is a good idea to see what code is being generated by the
# compiler. Set GENERATE_ASM to 1 to do this, and you will get .s files
# in the build-cli directory. To do this only on demand, you can say
# make GENERATE_ASM=1
# So for example if you only want to look at the assembly for the main
# program, compile everything, touch the code, and do a make with the
# GENERATE_ASM set in the command.
# GENERATE_ASM = 1