Auto-initialize optional submodules when needed

This commit is contained in:
2024-09-27 18:06:42 +02:00
parent ae329083db
commit dec3d53c59
5 changed files with 24 additions and 16 deletions

View File

@@ -22,6 +22,7 @@ OBJCOPY := avr-objcopy
AVD := avrdude
MKDIR := mkdir -p
RMR := rm -rf
GIT := git
SRCDIR := src
BINDIR := bin
@@ -79,19 +80,24 @@ distclean: clean
$(Q) $(RMR) $(BINDIR)
.PHONY: listen
listen: ./opt/tools/serial-listen.py
$(E) "[PY3] $<"
listen: opt/tools/serial-listen
$(E) "[RUN] $<"
$(Q) ./$<
.PHONY: webgui
webgui: ./opt/webgui/Makefile
$(E) "[MAK] $(<D)"
webgui: opt/webgui/Makefile
$(E) "[MAK] $<"
$(Q) $(MAKE) -sC $(<D)
$(TMPDIRS):
$(E) "[DIR] $@"
$(Q) $(MKDIR) $@
# Initialize optional git submodules if needed
opt/tools/serial-listen opt/webgui/Makefile:
$(E) "[GIT] Initializing submodules..."
$(Q) $(GIT) submodule update --init
# ==============================================================================
# PRIMARY BUILD TARGET AND PATTERN RULES
# ==============================================================================