11ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
22BUNDLE_NAME = code-bundle
33BUNDLE_DIR = $(shell dirname $(ROOT_DIR ) ) /$(BUNDLE_NAME )
4+ BUNDLE_PARENT = $(shell dirname $(BUNDLE_DIR ) )
45BUNDLE_ZIP = $(BUNDLE_DIR ) .zip
6+ BUNDLE_GZIP = $(BUNDLE_DIR ) .tgz
7+ BUNDLE_BZIP2 = $(BUNDLE_DIR ) .tbz2
58CHAPTERS = 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
2341bundle : $(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
2848download-code :
2949 @echo
@@ -49,7 +69,9 @@ bundle-clean:
4969
5070bundle-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
5577clean-all : bundle-clean bundle-zip-clean
0 commit comments