forked from joeycastillo/second-movement
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
192 lines (161 loc) · 5.69 KB
/
Makefile
File metadata and controls
192 lines (161 loc) · 5.69 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Keep this first line.
GOSSAMER_PATH=gossamer
DEFAULT_BOARD = sensorwatch_pro
DEFAULT_DISPLAY = classic
# Which board are we building for? Commented out to force a choice when building.
# Options are:
# - sensorwatch_pro
# - sensorwatch_green
# - sensorwatch_red (also known as Sensor Watch Lite)
# - sensorwatch_blue
# BOARD=sensorwatch_pro
ifeq (,$(filter clean install,$(MAKECMDGOALS)))
ifndef BOARD
BOARD = $(DEFAULT_BOARD)
$(info Setting Board to: $(BOARD))
endif
ifeq ($(BOARD),lite)
DISPLAY = classic
override BOARD = sensorwatch_red
$(info Setting Board to: $(BOARD))
$(info Setting Display to: $(DISPLAY))
endif
# Set this to the type of display in your watch: classic or custom. Commented out to force a choice when building.
# DISPLAY=classic
ifeq ($(DISPLAY),:0)
DISPLAY = $(DEFAULT_DISPLAY)
$(info Setting Display to: $(DISPLAY))
endif
endif
# End of user configurable options.
# Support USB features?
TINYUSB_CDC=1
# Now we're all set to include gossamer's make rules.
include $(GOSSAMER_PATH)/make.mk
# Don't add gossamer's rtc.c since we are using our own rtc32.c
SRCS := $(filter-out $(GOSSAMER_PATH)/peripherals/rtc.c,$(SRCS))
CFLAGS+=-D_POSIX_C_SOURCE=200112L
define n
endef
# Don't require BOARD or DISPLAY for `make clean` or `make install`
ifeq (,$(filter clean,$(MAKECMDGOALS)))
ifeq (,$(filter install,$(MAKECMDGOALS)))
ifndef BOARD
$(error Build failed: BOARD not defined. Use one of the four options below, depending on your hardware:$n$n make BOARD=sensorwatch_red DISPLAY=display_type$n make BOARD=sensorwatch_blue DISPLAY=display_type$n make BOARD=sensorwatch_pro DISPLAY=display_type$n$n)
endif
endif
ifeq (,$(filter install,$(MAKECMDGOALS)))
ifndef DISPLAY
$(error Build failed: DISPLAY not defined. Use one of the options below, depending on your hardware:$n$n make BOARD=board_type DISPLAY=classic$n make BOARD=board_type DISPLAY=custom$n$n)
else
ifeq ($(DISPLAY), custom)
DEFINES += -DFORCE_CUSTOM_LCD_TYPE
else ifeq ($(DISPLAY), classic)
DEFINES += -DFORCE_CLASSIC_LCD_TYPE
else ifeq ($(DISPLAY), autodetect)
$(warning WARNING: LCD autodetection is experimental and not reliable! We suggest specifying DISPLAY=classic or DISPLAY=custom for reliable operation.)
else
$(error Build failed: invalid DISPLAY type. Use one of the options below, depending on your hardware:$n$n make BOARD=board_type DISPLAY=classic$n make BOARD=board_type DISPLAY=custom$n$n)
endif
endif
endif
endif
ifdef NOSLEEP
DEFINES += -DMOVEMENT_LOW_ENERGY_MODE_FORBIDDEN
endif
# Emscripten targets are now handled in rules.mk in gossamer
# Add your include directories here.
INCLUDES += \
-I./ \
-I. \
-I./tinyusb/src \
-I./littlefs \
-I./utz \
-I./filesystem \
-I./shell \
-I./lib/sunriset \
-I./lib/sha1 \
-I./lib/sha256 \
-I./lib/sha512 \
-I./lib/base32 \
-I./lib/TOTP \
-I./lib/chirpy_tx \
-I./lib/base64 \
-I./lib/embedded_pedometer \
-I./watch-library/shared/watch \
-I./watch-library/shared/driver \
-I./watch-faces/clock \
-I./watch-faces/complication \
-I./watch-faces/demo \
-I./watch-faces/sensor \
-I./watch-faces/settings \
-I./watch-faces/io \
-I./legacy/watch_faces/complication \
# Add your source files here.
SRCS += \
./dummy.c \
./littlefs/lfs.c \
./littlefs/lfs_util.c \
./filesystem/filesystem.c \
./utz/utz.c \
./utz/zones.c \
./shell/shell.c \
./shell/shell_cmd_list.c \
./lib/sunriset/sunriset.c \
./lib/base32/base32.c \
./lib/TOTP/sha1.c \
./lib/TOTP/sha256.c \
./lib/TOTP/sha512.c \
./lib/TOTP/TOTP.c \
./lib/chirpy_tx/chirpy_tx.c \
./lib/base64/base64.c \
./lib/embedded_pedometer/count_steps.c \
./watch-library/shared/driver/thermistor_driver.c \
./watch-library/shared/watch/watch_common_buzzer.c \
./watch-library/shared/watch/watch_common_display.c \
./watch-library/shared/watch/watch_utility.c \
SRCS += ./watch-library/shared/driver/lis2dw.c
SRCS += ./watch-library/shared/driver/lis2dux12_reg.c
ifdef EMSCRIPTEN
INCLUDES += \
-I./watch-library/simulator/watch \
SRCS += \
./watch-library/simulator/watch/watch.c \
./watch-library/simulator/watch/watch_adc.c \
./watch-library/simulator/watch/watch_deepsleep.c \
./watch-library/simulator/watch/watch_extint.c \
./watch-library/simulator/watch/watch_gpio.c \
./watch-library/simulator/watch/watch_i2c.c \
./watch-library/simulator/watch/watch_private.c \
./watch-library/simulator/watch/watch_rtc.c \
./watch-library/simulator/watch/watch_slcd.c \
./watch-library/simulator/watch/watch_spi.c \
./watch-library/simulator/watch/watch_storage.c \
./watch-library/simulator/watch/watch_tcc.c \
./watch-library/simulator/watch/watch_uart.c \
else
INCLUDES += \
-I./watch-library/hardware/watch \
SRCS += \
./watch-library/hardware/watch/rtc32.c \
./watch-library/hardware/watch/watch.c \
./watch-library/hardware/watch/watch_adc.c \
./watch-library/hardware/watch/watch_deepsleep.c \
./watch-library/hardware/watch/watch_extint.c \
./watch-library/hardware/watch/watch_gpio.c \
./watch-library/hardware/watch/watch_i2c.c \
./watch-library/hardware/watch/watch_private.c \
./watch-library/hardware/watch/watch_rtc.c \
./watch-library/hardware/watch/watch_slcd.c \
./watch-library/hardware/watch/watch_spi.c \
./watch-library/hardware/watch/watch_storage.c \
./watch-library/hardware/watch/watch_tcc.c \
./watch-library/hardware/watch/watch_uart.c \
./watch-library/hardware/watch/watch_usb_descriptors.c \
./watch-library/hardware/watch/watch_usb_cdc.c \
endif
include watch-faces.mk
SRCS += \
./movement.c \
# Finally, leave this line at the bottom of the file.
include $(GOSSAMER_PATH)/rules.mk