diff --git a/.gitignore b/.gitignore index a2c63ce..d163863 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -build/ -libwdsp*.a +build/ \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 345449b..610a551 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,5 @@ { "recommendations": [ - "marus25.cortex-debug", "ms-vscode.cpptools" ] } \ No newline at end of file diff --git a/buildvars.mk b/buildvars.mk index d325309..57fcca6 100644 --- a/buildvars.mk +++ b/buildvars.mk @@ -4,17 +4,18 @@ export OPT ?= -O3 export DEBUG ?= false export BOARD ?= wdsp-dev +export BUILD_ROOT ?= build ifeq ($(DEBUG), true) -export LIB_NAME ?= libwdsp-debug +export BUILD_DIR ?= $(BUILD_ROOT)/debug/$(BOARD) else -export LIB_NAME ?= libwdsp +export BUILD_DIR ?= $(BUILD_ROOT)/release/$(BOARD) endif ifeq ($(DEBUG), true) -export BUILD_DIR ?= build/debug/$(BOARD) +export LIB_NAME ?= $(BUILD_ROOT)/libwdsp-$(BOARD)-debug else -export BUILD_DIR ?= build/release/$(BOARD) +export LIB_NAME ?= $(BUILD_ROOT)/libwdsp-$(BOARD) endif export CONFIG_DIR = $(BUILD_DIR)/config diff --git a/libwdsp.mk b/libwdsp.mk index e99afd4..b2f5748 100644 --- a/libwdsp.mk +++ b/libwdsp.mk @@ -11,13 +11,14 @@ endif WDSP_PATH := $(dir $(lastword $(MAKEFILE_LIST))) CONFIG_FILE ?= $(wildcard ./config.ini) -export USER_CONFIG ?= $(realpath $(CONFIG_FILE)) +export USER_CONFIG ?= $(abspath $(CONFIG_FILE)) +export BUILD_ROOT ?= $(abspath .wdsp) include $(WDSP_PATH)/buildvars.mk include $(WDSP_PATH)/init.mk C_INCLUDES = \ --I $(WDSP_PATH)/$(CONFIG_DIR) \ +-I $(CONFIG_DIR) \ -I $(WDSP_PATH)/includes/libwdsp \ -I $(WDSP_PATH)/boards/$(BOARD) \ -I $(WDSP_PATH)/cores/$(CORE) @@ -46,7 +47,7 @@ $(TARGET).hex: $(TARGET) $(TARGET).bin: $(TARGET) $(BIN) $< $@ -$(TARGET): $(WDSP_PATH)/$(LIB_NAME).a +$(TARGET): $(LIB_NAME).a .PHONY: libclean libclean: diff --git a/template/.gitignore b/template/.gitignore new file mode 100644 index 0000000..c1d38e9 --- /dev/null +++ b/template/.gitignore @@ -0,0 +1,4 @@ +# Example .gitignore only ignores libWDSP out of tree build directory. +# Add your own ignores to suit your taste. + +.wdsp/