Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions module/base/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,38 @@ info:
@echo Objetos: $(PROJECT_OBJ)
@echo -------------------------------------------------------------------------------
@echo Definciones: $(DEFINES)

##################################################################################################
#
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
TAB := $(EMPTY) $(EMPTY)
json_list = $(subst $(SPACE),$(COMMA)$(SPACE),$(strip $(foreach w,$1,"$w")))

MY_INCLUDES = $(strip $(foreach p,$(PROJECT_INC),$(subst $(abspath $(PROJECT_DIR)),$(PROJECT_DIR),$(call full_path,$(p)))))

define vscode_c_config
{
"configurations": [
{
"name": "MUJU",
"includePath": [$(call json_list,$(MY_INCLUDES))],
"defines": [$(call json_list,$(DEFINES))],
"cStandard": "c99",
"intelliSenseMode": "$${default}",
"compilerPath":"$(subst \,\\,$(shell $(CC) -v 2>&1 | awk '/COLLECT_GCC=/ {sub(/[^=]+=/,"");print}'))"
}
],
"version": 4
}
endef

VSCODE_DIR=$(PROJECT_DIR)/.vscode
VSCODE_CFG=$(VSCODE_DIR)/c_cpp_properties.json

config_vscode: |$(VSCODE_DIR)
@echo "Creating or replacing $(VSCODE_CFG) $(file > $(VSCODE_CFG),$(subst $(TAB),$(SPACE)$(SPACE),$(vscode_c_config)))"

$(VSCODE_DIR):
$(QUIET) mkdir -p $(VSCODE_DIR)