Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Introduce new variable UPDATE, if enabled, sources are updated before…
Browse files Browse the repository at this point in the history
… each build
  • Loading branch information
p4u committed Sep 27, 2014
1 parent 6769ccb commit 9617394
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ define get_git_remote_revision
git ls-remote origin $1 | awk 'NR==1{print $$1}'
endef

define update_all
@echo Updating LiMe repository
(cd $(BUILD_DIR)/$(LIME_PKG_DIR) && git pull && git checkout $(LIME_GIT_BRANCH) && git pull origin $(LIME_GIT_BRANCH))
@echo Updating feeds config files
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call copy_feeds_file,$(dir))))
@echo Updating feeds
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call update_feeds,$(dir))))
endef

all: build

.checkout_lime_pkg:
Expand All @@ -198,7 +207,7 @@ all: build

checkout: .checkout_lime_pkg .checkout_owrt .checkout_owrt_pkg .checkout_owrt_pkg_override
$(if $(TARGET),,$(call target_error))
(cd $(BUILD_DIR)/$(LIME_PKG_DIR) && git pull && git checkout $(LIME_GIT_BRANCH) && git pull origin $(LIME_GIT_BRANCH))
$(if $(UPDATE),$(call update_all),)
$(if $(wildcard .checkout_$(TBUILD)),,$(call update_feeds,$(TBUILD)))
$(if $(wildcard .checkout_$(TBUILD)),,$(call copy_config))
@touch .checkout_$(TBUILD)
Expand All @@ -213,12 +222,7 @@ update: .checkout_owrt_pkg .checkout_owrt_pkg_override .checkout_lime_pkg
$(call copy_feeds_file)

update_all: .checkout_owrt_pkg .checkout_owrt_pkg_override .checkout_lime_pkg
@echo Updating LiMe repository
(cd $(BUILD_DIR)/$(LIME_PKG_DIR) && git pull && git checkout $(LIME_GIT_BRANCH) && git pull origin $(LIME_GIT_BRANCH))
@echo Updating feeds config files
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call copy_feeds_file,$(dir))))
@echo Updating feeds
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call update_feeds,$(dir))))
$(call update_all)

update_feeds: update
$(call update_feeds,$(TBUILD))
Expand Down
1 change: 1 addition & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ COMMUNITY ?= LibreMesh
SCRIPTS_DIR= scripts
LIME_PKG_DIR = lime-packages
TBUILD ?= trunk
UPDATE ?=

0 comments on commit 9617394

Please sign in to comment.