diff --git a/.gitignore b/.gitignore index d045c8b67..c577e153d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ /tools /build /3rdparty + +# Ignore user config +config + # Exclude temporary and system files Thumbs.db diff --git a/Makefile b/Makefile index d604f5541..bb9bbb302 100644 --- a/Makefile +++ b/Makefile @@ -60,10 +60,10 @@ smallify = $(subst $(SPACE),-,$(call lc,$1)) # Naming for binaries and packaging etc,. ORG_BIG_NAME := LibrePilot -GCS_BIG_NAME := ${ORG_BIG_NAME} GCS +GCS_BIG_NAME = ${ORG_BIG_NAME} GCS # These should be lowercase with no spaces -ORG_SMALL_NAME := $(call smallify,$(ORG_BIG_NAME)) -GCS_SMALL_NAME := $(call smallify,$(GCS_BIG_NAME)) +ORG_SMALL_NAME = $(call smallify,$(ORG_BIG_NAME)) +GCS_SMALL_NAME = $(call smallify,$(GCS_BIG_NAME)) # Set up default build configurations (debug | release) GCS_BUILD_CONF := release @@ -140,6 +140,9 @@ else ifeq ($(UNAME), Windows) UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe endif +CONFIG_FILE := config +-include $(CONFIG_FILE) + ############################## # # All targets @@ -842,6 +845,27 @@ $(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR) dist: $(DIST_NAME).gz +############################## +# +# Config +# +############################## + +CONFIG_OPTS := $(subst $(SPACE),\n,$(MAKEOVERRIDES)) + +.PHONY: config_new +config_new: + @echo -e '$(CONFIG_OPTS)' > $(CONFIG_FILE) + +.PHONY: config_append +config_append: + @echo -e '$(CONFIG_OPTS)' >> $(CONFIG_FILE) + +.PHONY: config_clean +config_clean: + rm -f $(CONFIG_FILE) + + ############################## # # Directories @@ -993,6 +1017,11 @@ help: @$(ECHO) " docs__clean - Delete generated documentation for " @$(ECHO) " docs_all_clean - Delete all generated documentation" @$(ECHO) + @$(ECHO) " [Configuration]" + @$(ECHO) " config_new - Place your make arguments in the config file" + @$(ECHO) " config_append - Place your make arguments in the config file but append" + @$(ECHO) " config_clean - Removes the config file" + @$(ECHO) @$(ECHO) " Hint: Add V=1 to your command line to see verbose build output." @$(ECHO) @$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"