From b18523d6908db8504eb7ee308a3088f55c1c897e Mon Sep 17 00:00:00 2001 From: James Duley Date: Sat, 18 Jul 2015 13:10:19 +1200 Subject: [PATCH 1/3] Added option for config file. Things the can be added to config file are: export PATH := /usr/lib/ccache/bin:$(PATH) GCS_OPTS := XXX etc --- .gitignore | 4 ++++ Makefile | 3 +++ 2 files changed, 7 insertions(+) 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 c3667097f..4df97505a 100644 --- a/Makefile +++ b/Makefile @@ -140,6 +140,9 @@ else ifeq ($(UNAME), Windows) UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe endif +CONFIG_FILE := config +-include $(CONFIG_FILE) + ############################## # # All targets From 9097c8b11885d3e9832219d58be4142dea8c0f1b Mon Sep 17 00:00:00 2001 From: James Duley Date: Sun, 19 Jul 2015 02:22:58 +1200 Subject: [PATCH 2/3] Added options to make config file --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Makefile b/Makefile index 4df97505a..15f64499f 100644 --- a/Makefile +++ b/Makefile @@ -844,6 +844,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 @@ -995,6 +1016,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)" From 1934dbc427f0bccb399067d1f3b2c07b98768406 Mon Sep 17 00:00:00 2001 From: James Duley Date: Mon, 20 Jul 2015 00:33:27 +1200 Subject: [PATCH 3/3] Make names configurable with config file --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 15f64499f..1454a5c09 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