Add libpl submodule (#753)

* Add libpl submodule

* Clone libpl submodule automatically while building (if enabled)
This commit is contained in:
Gregory Heskett
2024-02-02 22:08:34 -05:00
committed by GitHub
parent 5064fcfb69
commit b9ba17a4d6
7 changed files with 54 additions and 1 deletions

View File

@@ -253,6 +253,18 @@ ifeq ($(HVQM),1)
SRC_DIRS += src/hvqm
endif
# LIBPL - whether to include libpl library for interfacing with Parallel Launcher
# (library will be pulled into repo after building with this enabled for the first time)
# 1 - includes code in ROM
# 0 - does not
LIBPL ?= 0
LIBPL_DIR := lib/libpl
$(eval $(call validate-option,LIBPL,0 1))
ifeq ($(LIBPL),1)
DEFINES += LIBPL=1
SRC_DIRS += $(LIBPL_DIR)
endif
BUILD_DIR_BASE := build
# BUILD_DIR is the location where all build artifacts are placed
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
@@ -335,6 +347,18 @@ ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
ifeq ($(DUMMY),FAIL)
$(error Failed to build tools)
endif
# Clone any needed submodules
ifeq ($(LIBPL),1)
ifeq ($(wildcard $(LIBPL_DIR)),)
$(info Cloning libpl submodule...)
DUMMY != git submodule update --init $(LIBPL_DIR) > /dev/null || echo FAIL
ifeq ($(DUMMY),FAIL)
$(error Failed to clone libpl submodule)
endif
endif
endif
$(info Building ROM...)
endif