Statistics
| Branch: | Revision:

imlightsw / Makefile @ 2b157eb1

History | View | Annotate | Download (3.4 KB)

1
# Build for Arduino-based, PiBox controlled
2
# IoT Device based on ESP8266.
3
#
4
# ----------------------------------------------------------------------
5
# Directory and other setup
6
# ----------------------------------------------------------------------
7
# Top of ESP8266 related utilites (Arduino, makeEspArduino, etc.)
8
# ESPTOP should be set in your copy of docs/arduino.sh
9
ESP_TOP = $(ESPTOP)
10

    
11
# Esp8266 Arduino git location
12
# If this is a symlink, make sure to place a "/" at the end!
13
ESP_ROOT = $(ESP_TOP)/arduino/
14

    
15
# makeEspArduino git location
16
ESP_MK_TOP = $(ESP_TOP)/makeEspArduino
17
ESP_MK     = $(ESP_MK_TOP)/makeEspArduino.mk
18

    
19
# Where are the ESP libraries stored?
20
ESPLIBDIR = $(ESP_ROOT)/libraries
21

    
22
# Output directory
23
BUILD_ROOT = $(GM_BUILD)
24
BUILD_DIR  = $(BUILD_ROOT)
25

    
26
# makeEspArduino Overrides
27

    
28
# ----------------------------------
29
# Configurable upload parameters
30
# UPLOAD_SPEED ?= 230400
31
# UPLOAD_PORT ?= /dev/ttyUSB0
32
# UPLOAD_VERB ?= -v
33
# ----------------------------------
34
UPLOAD_SPEED = 115200
35
UPLOAD_PORT  = $(shell echo $(SERIALDEV))
36
# UPLOAD_VERB  = -v
37

    
38
# ----------------------------------
39
# Configurable board parameters
40
# FLASH_SIZE ?= 4M
41
# FLASH_MODE ?= dio
42
# FLASH_SPEED ?= 40
43
# FLASH_LAYOUT ?= eagle.flash.4m.ld
44
# ----------------------------------
45
# Flash size for ESP-01
46
FLASH_SIZE = 1M
47

    
48
# ----------------------------------------------------------------------
49
#  Project setup
50
# ----------------------------------------------------------------------
51
# Which libraries are we using in our project?
52
# These work if they have .cpp files.  See also USER_DIRS.
53
# LIBS+=$(ESPLIBDIR)/Wire
54
# LIBS+=$(ESPLIBDIR)/EEPROM
55
# LIBS+=$(ESPLIBDIR)/ESP8266mDNS
56

    
57
# From Arduino Core
58
LIBS =$(ESPLIBDIR)/ESP8266WiFi
59
LIBS+=$(ESPLIBDIR)/ESP8266WebServer
60
LIBS+=$(ESPLIBDIR)/ESP8266HTTPClient
61
LIBS+=$(ESPLIBDIR)/WiFiManager
62
LIBS+=$(ESPLIBDIR)/DNSServer
63

    
64
# Required Downloads
65
LIBS+=$(ESPLIBDIR)/Timer
66
LIBS+=$(ESPLIBDIR)/AES
67
LIBS+=$(ESPLIBDIR)/aJson
68

    
69
# Name of our "sketch" (a .ino, aka .c, file)
70
SKETCH = PiBox/imlightsw.ino
71

    
72
# ----------------------------------------------------------------------
73
# Now includes the makefile that makes building with GNU Make easier.
74
# ----------------------------------------------------------------------
75
include $(ESP_MK_TOP)/makeEspArduino.mk
76

    
77
# Add include directories like this.  
78
# INCLUDE_DIRS += $(SDK_ROOT)/lwip2/include
79

    
80
# This is required for libraries which provide .h files only - no .cpp files.
81
# USER_DIRS+=$(ESPLIBDIR)/aREST
82

    
83
# Updated CFLAGS
84
ifneq ($(RESET),)
85
C_DEFINES += -DRESET
86
endif
87

    
88
# Use serial console instead of Blue LED
89
ifneq ($(SERIAL),)
90
C_DEFINES += -DUSE_SERIAL
91
endif
92

    
93
# Enabled debugging in the core
94
ifneq ($(DEBUGV),)
95
C_DEFINES += -DDEBUG_ESP_CORE -DDEBUG_ESP_PORT=Serial1 -DDEBUG_CORE
96
endif
97

    
98
# Use VERBOSE=1 to have verbose build
99
ifneq ($(VERBOSE),)
100
CPP += -v
101
endif
102

    
103
# ----------------------------------------------------------------------
104
# Project specific targets
105
# ----------------------------------------------------------------------
106
clobber:
107
	rm -rf $(BUILD_ROOT)
108

    
109
showconfig:
110
	echo "ESP_TOP     : $(ESP_TOP)"
111
	echo "ESP_ROOT    : $(ESP_ROOT)"
112
	echo "SDK_ROOT    : $(SDK_ROOT)"
113
	echo "BUILD_ROOT  : $(BUILD_ROOT)"
114
	echo "INCLUDE_DIRS: $(INCLUDE_DIRS)"
115
	echo "BUILD_ROOT  : $(BUILD_ROOT)"
116
	echo "UPLOAD_SPEED: $(UPLOAD_SPEED)"
117
	echo "UPLOAD_PORT : $(UPLOAD_PORT)"
118
	echo "FLASH_SIZE  : $(FLASH_SIZE)"
119
	echo "ESPLIBDIR   : $(ESPLIBDIR)"
120
	echo "C_INCLUDES  : $(C_INCLUDES)"
121
	echo "USER_DIRS   : $(USER_DIRS)"
122