From c40221abb628ac66d1adebb7e48f312846a3f88f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Tue, 22 Jul 2025 23:31:38 +0300 Subject: [PATCH] Allow using the DISABLE_* flags when building specific subsets of the lib target --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 0b70b26..b562788 100644 --- a/Makefile +++ b/Makefile @@ -100,15 +100,8 @@ else CPPP_FLAGS += -UGB_DISABLE_CHEAT_SEARCH endif -ifneq ($(CORE_FILTER)$(DISABLE_TIMEKEEPING),) -ifneq ($(MAKECMDGOALS),lib) -$(error SameBoy features can only be disabled when compiling the 'lib' target) -endif -endif - CPPP_FLAGS += -UGB_INTERNAL - include version.mk COPYRIGHT_YEAR := $(shell grep -oE "20[2-9][0-9]" LICENSE) export VERSION @@ -121,6 +114,12 @@ LIBDIR := build/lib PKGCONF_DIR := $(LIBDIR)/pkgconfig PKGCONF_FILE := $(PKGCONF_DIR)/sameboy.pc +ifneq ($(CORE_FILTER)$(DISABLE_TIMEKEEPING),) +ifneq ($(filter-out lib $(LIBDIR)/% $(INC)/%,$(MAKECMDGOALS)),) +$(error SameBoy features can only be disabled when compiling the 'lib' target) +endif +endif + BOOTROMS_DIR ?= $(BIN)/BootROMs ifdef DATA_DIR