← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master

 

Ines Almeida has proposed merging ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master.

Commit message:
Refactor Makefile logic

This will ensure that the dependencies repository isn't cloned on every command that builds the virtual env which should be unnecessary in a few cases, e.g., when the txpkgupload charm builds from the tarball (given the tarball should already contain the dependencies)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/txpkgupload/+git/txpkgupload/+merge/446311
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master.
diff --git a/Makefile b/Makefile
index 55d04d0..bc69913 100644
--- a/Makefile
+++ b/Makefile
@@ -36,10 +36,14 @@ SWIFT_OBJECT_PATH = \
 	$(SWIFT_CONTAINER_NAME)/$(TARBALL_BUILD_LABEL)/$(TARBALL_FILE_NAME)
 
 
-default: compile
+default: bootstrap
 
 
-bootstrap compile:
+bootstrap: $(DEPENDENCY_DIR)
+	$(MAKE) compile
+
+
+compile:
 	$(MAKE) $(ENV)
 	[ ! -d .git ] || $(MAKE) $(VERSION_INFO)
 
@@ -68,7 +72,7 @@ $(DEPENDENCY_DIR):
 	git clone $(DEPENDENCY_REPO) $(DEPENDENCY_DIR)
 
 
-$(ENV): | $(DEPENDENCY_DIR)
+$(ENV):
 	mkdir -p $(ENV)
 	(echo '[easy_install]'; \
 	 echo 'find_links = file://$(DEPENDENCY_DIR)/') \
@@ -105,8 +109,7 @@ clean: clean_pip
 build-tarball:
 	@echo "Creating deployment tarball at $(TARBALL_BUILD_PATH)"
 	rm -rf $(ENV)
-	$(MAKE) $(ENV)
-	$(MAKE) $(VERSION_INFO)
+	$(MAKE) boorstrap
 	$(PIP) wheel -f $(DEPENDENCY_DIR) --no-index -w $(WHEELS) \
 		-r bootstrap-requirements.txt -r requirements.txt
 	mkdir -p $(TARBALL_BUILD_DIR)

Follow ups