From 8f98ab238866b10c2f522288febb617fcb1755fb Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Mon, 18 Jan 2021 12:20:14 +0100 Subject: [PATCH] Allow building projects outside the examples dir Project Makefiles can now define a DPF_CUSTOM_PATH When setting a DPF_CUSTOM_PATH also DPF_CUSTOM_TARGET_DIR (for binaries) and DPF_CUSTOM_BUILD_DIR (objects) need to be set. If the project depends on DPF's graphic library, it has to be built first by cd'ing to DPF and running make dgl --- Makefile.plugins.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk index cc7cade5..5cd9be1f 100644 --- a/Makefile.plugins.mk +++ b/Makefile.plugins.mk @@ -7,19 +7,36 @@ # NOTE: NAME, FILES_DSP and FILES_UI must have been defined before including this file! +ifeq ($(DPF_CUSTOM_PATH),) ifeq (,$(wildcard ../../Makefile.base.mk)) DPF_PATH=../../dpf else DPF_PATH=../.. endif +else +DPF_PATH = $(DPF_CUSTOM_PATH) +endif include $(DPF_PATH)/Makefile.base.mk # --------------------------------------------------------------------------------------------------------------------- # Basic setup +ifeq ($(DPF_CUSTOM_PATH),) TARGET_DIR = ../../bin BUILD_DIR = ../../build/$(NAME) +else +ifeq ($(DPF_CUSTOM_TARGET_DIR),) +$(error DPF_CUSTOM_TARGET_DIR is not set) +else +TARGET_DIR = $(DPF_CUSTOM_TARGET_DIR) +endif +ifeq ($(DPF_CUSTOM_BUILD_DIR),) +$(error DPF_CUSTOM_BUILD_DIR is not set) +else +BUILD_DIR = $(DPF_CUSTOM_BUILD_DIR) +endif +endif BUILD_C_FLAGS += -I. BUILD_CXX_FLAGS += -I. -I$(DPF_PATH)/distrho -I$(DPF_PATH)/dgl