[BUILD] Add source library path to the examples makefile to override default paths
This commit is contained in:
6
Makefile
6
Makefile
@@ -29,6 +29,8 @@ Q := @
|
|||||||
MAKEFLAGS += --no-print-directory
|
MAKEFLAGS += --no-print-directory
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
OPENCM3_DIR := $(realpath libopencm3)
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build: lib examples
|
build: lib examples
|
||||||
@@ -49,7 +51,7 @@ lib:
|
|||||||
EXAMPLE_DIRS:=$(sort $(dir $(wildcard $(addsuffix /*/*/Makefile,$(addprefix examples/,$(TARGETS))))))
|
EXAMPLE_DIRS:=$(sort $(dir $(wildcard $(addsuffix /*/*/Makefile,$(addprefix examples/,$(TARGETS))))))
|
||||||
$(EXAMPLE_DIRS): lib
|
$(EXAMPLE_DIRS): lib
|
||||||
@printf " BUILD $@\n";
|
@printf " BUILD $@\n";
|
||||||
$(Q)$(MAKE) --directory=$@
|
$(Q)$(MAKE) --directory=$@ OPENCM3_DIR=$(OPENCM3_DIR)
|
||||||
|
|
||||||
examples: $(EXAMPLE_DIRS)
|
examples: $(EXAMPLE_DIRS)
|
||||||
$(Q)true
|
$(Q)true
|
||||||
@@ -60,7 +62,7 @@ clean: $(EXAMPLE_DIRS:=.clean)
|
|||||||
%.clean:
|
%.clean:
|
||||||
$(Q)if [ -d $* ]; then \
|
$(Q)if [ -d $* ]; then \
|
||||||
printf " CLEAN $*\n"; \
|
printf " CLEAN $*\n"; \
|
||||||
$(MAKE) -C $* clean SRCLIBDIR=$(SRCLIBDIR) || exit $?; \
|
$(MAKE) -C $* clean OPENCM3_DIR=$(OPENCM3_DIR) || exit $?; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user