Skip to content

Commit 3bfd30c

Browse files
committed
Minor Makefile enhancements
1 parent 81038b8 commit 3bfd30c

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22

33
MOS ?= mos
44
LOCAL ?= 0
5+
CLEAN ?= 0
6+
VERBOSE ?= 0
57
MOS_BUILD_FLAGS ?=
68
BUILD_DIR ?= ./build_$*
79

10+
MAKEFLAGS += --warn-undefined-variables
11+
12+
MOS_BUILD_FLAGS_FINAL = $(MOS_BUILD_FLAGS)
813
ifeq "$(LOCAL)" "1"
9-
MOS_BUILD_FLAGS += --local
14+
MOS_BUILD_FLAGS_FINAL += --local
15+
endif
16+
ifeq "$(CLEAN)" "1"
17+
MOS_BUILD_FLAGS_FINAL += --clean
18+
endif
19+
ifeq "$(VERBOSE)" "1"
20+
MOS_BUILD_FLAGS_FINAL += --verbose
1021
endif
1122

1223
build: Shelly1 Shelly1PM Shelly2 Shelly25 ShellyPlugS
@@ -30,12 +41,15 @@ Shelly2: build-Shelly2
3041
Shelly25: build-Shelly25
3142
@true
3243

33-
fs:
44+
fs/index.html.gz: fs_src/index.html
3445
gzip -9 -c fs_src/index.html > fs/index.html.gz
46+
47+
fs/style.css.gz: fs_src/style.css
3548
gzip -9 -c fs_src/style.css > fs/style.css.gz
3649

37-
build-%: fs
38-
$(MOS) build --platform=esp8266 --build-var=MODEL=$* $(MOS_BUILD_FLAGS) --build-dir=$(BUILD_DIR) --binary-libs-dir=./binlibs
50+
build-%: fs/index.html.gz fs/style.css.gz
51+
$(MOS) build --platform=esp8266 --build-var=MODEL=$* \
52+
--build-dir=$(BUILD_DIR) --binary-libs-dir=./binlibs $(MOS_BUILD_FLAGS_FINAL)
3953
cp $(BUILD_DIR)/fw.zip shelly-homekit-$*.zip
4054

4155
upload-%:

0 commit comments

Comments
 (0)