Skip to content

Commit

Permalink
Adjust last commit to work for DPF example plugins
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Mar 9, 2024
1 parent 564a477 commit 0ceb411
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Makefile.plugins.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,31 @@
# Try to figure out where DPF is located

ifeq ($(DPF_PATH),)

# find path to this makefile
DPF_PLUGINS_MAKEFILE = $(lastword $(filter %Makefile.plugins.mk,$(MAKEFILE_LIST)))
DPF_PATH = $(patsubst %/,%,$(patsubst %Makefile.plugins.mk,%,$(DPF_PLUGINS_MAKEFILE)))

# error out if wrongly named or referencing it without any path
ifeq (,$(findstring /Makefile.plugins.mk,$(DPF_PLUGINS_MAKEFILE)))
$(error wrong inclusion of Makefile.plugins.mk, must be either absolute or relative path)
endif

# find path to DPF
DPF_PATH = $(patsubst %/Makefile.plugins.mk,%,$(DPF_PLUGINS_MAKEFILE))

# best guess for where to place binary files
ifeq ($(DPF_PATH),..)
BASE_PATH = $(DPF_PATH)
else ifeq ($(DPF_PATH),../..)
BASE_PATH = $(DPF_PATH)
else ifeq ($(DPF_PATH),../../..)
BASE_PATH = $(DPF_PATH)
else
BASE_PATH = $(patsubst %/,%,$(dir $(DPF_PATH)))
endif

endif

include $(DPF_PATH)/Makefile.base.mk

# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 0ceb411

Please sign in to comment.