1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

Merge pull request #42 from parched/add_config

Added option for config file.
This commit is contained in:
James Duley 2015-07-19 15:39:43 +01:00
commit 4efb8cd5c7
2 changed files with 36 additions and 3 deletions

4
.gitignore vendored
View File

@ -3,6 +3,10 @@
/tools /tools
/build /build
/3rdparty /3rdparty
# Ignore user config
config
# Exclude temporary and system files # Exclude temporary and system files
Thumbs.db Thumbs.db

View File

@ -60,10 +60,10 @@ smallify = $(subst $(SPACE),-,$(call lc,$1))
# Naming for binaries and packaging etc,. # Naming for binaries and packaging etc,.
ORG_BIG_NAME := LibrePilot 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 # These should be lowercase with no spaces
ORG_SMALL_NAME := $(call smallify,$(ORG_BIG_NAME)) ORG_SMALL_NAME = $(call smallify,$(ORG_BIG_NAME))
GCS_SMALL_NAME := $(call smallify,$(GCS_BIG_NAME)) GCS_SMALL_NAME = $(call smallify,$(GCS_BIG_NAME))
# Set up default build configurations (debug | release) # Set up default build configurations (debug | release)
GCS_BUILD_CONF := release GCS_BUILD_CONF := release
@ -140,6 +140,9 @@ else ifeq ($(UNAME), Windows)
UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe
endif endif
CONFIG_FILE := config
-include $(CONFIG_FILE)
############################## ##############################
# #
# All targets # All targets
@ -842,6 +845,27 @@ $(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR)
dist: $(DIST_NAME).gz 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 # Directories
@ -993,6 +1017,11 @@ help:
@$(ECHO) " docs_<source>_clean - Delete generated documentation for <source>" @$(ECHO) " docs_<source>_clean - Delete generated documentation for <source>"
@$(ECHO) " docs_all_clean - Delete all generated documentation" @$(ECHO) " docs_all_clean - Delete all generated documentation"
@$(ECHO) @$(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) " Hint: Add V=1 to your command line to see verbose build output."
@$(ECHO) @$(ECHO)
@$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)" @$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"