Skip to content

Commit 2ea3eaa

Browse files
committed
Added more compressed file types.
1 parent e2d97cf commit 2ea3eaa

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

Makefile

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
22
BUNDLE_NAME = code-bundle
33
BUNDLE_DIR = $(shell dirname $(ROOT_DIR))/$(BUNDLE_NAME)
4+
BUNDLE_PARENT = $(shell dirname $(BUNDLE_DIR))
45
BUNDLE_ZIP = $(BUNDLE_DIR).zip
6+
BUNDLE_GZIP = $(BUNDLE_DIR).tgz
7+
BUNDLE_BZIP2 = $(BUNDLE_DIR).tbz2
58
CHAPTERS = 01-preview 02-architecture 03-apis 04-interaction 05-high-level 06-custom-and-config 07-cloud-deploy 08-big-data 09-clustering
6-
REPO_BASE = git@github.com:masteringmatplotlib
9+
REPO_BASE = https://github.com/masteringmatplotlib
710

811
# git clone git@github.com:masteringmatplotlib/preview.git 01-preview
912
# git submodule init && git submodule update
@@ -17,13 +20,30 @@ $(BUNDLE_DIR):
1720

1821
$(BUNDLE_ZIP):
1922
@echo
20-
@echo "Creating $(BUNDLE_ZIP) ..."
21-
@zip -r $(BUNDLE_DIR) $(BUNDLE_DIR)
23+
@echo "Creating compressed files ..."
24+
@make zip
25+
@make gzip
26+
@make bzip2
27+
28+
zip:
29+
@cd $(BUNDLE_PARENT) && zip -r $(BUNDLE_NAME) $(BUNDLE_DIR)
30+
31+
gzip:
32+
@cd $(BUNDLE_PARENT) && \
33+
tar -cvf - $(BUNDLE_NAME) | \
34+
gzip --best > $(BUNDLE_GZIP)
35+
36+
bzip2:
37+
@cd $(BUNDLE_PARENT) && \
38+
tar -cvf - $(BUNDLE_NAME) | \
39+
bzip2 --best > $(BUNDLE_BZIP2)
2240

2341
bundle: $(BUNDLE_DIR) $(BUNDLE_ZIP)
2442
@echo
25-
@echo "Your code bundle is available here:"
43+
@echo "Your code bundles are available here:"
2644
@echo " $(BUNDLE_ZIP)"
45+
@echo " $(BUNDLE_GZIP)"
46+
@echo " $(BUNDLE_BZIP2)"
2747

2848
download-code:
2949
@echo
@@ -49,7 +69,9 @@ bundle-clean:
4969

5070
bundle-zip-clean:
5171
@echo
52-
@echo "Removing $(BUNDLE_ZIP) ..."
72+
@echo "Removing compressed files ..."
5373
@rm -f $(BUNDLE_ZIP)
74+
@rm -f $(BUNDLE_GZIP)
75+
@rm -f $(BUNDLE_BZIP2)
5476

5577
clean-all: bundle-clean bundle-zip-clean

0 commit comments

Comments
 (0)