Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve plist-to-html's Makefile for multijob and no redundant downloads #1105

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions vendor/plist_to_html/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ BUILD_DIR = build
BIN_DIR = $(BUILD_DIR)/bin
DIST_DIR = $(BUILD_DIR)/dist

default: all

all: package

package: dep
Expand All @@ -19,12 +21,39 @@ package: dep
cp plist_to_html/dist/js/bugviewer.js $(DIST_DIR)
cp plist_to_html/PlistToHtml.py $(BIN_DIR)/plist-to-html

dep:
dist_dir:
mkdir -p $(DIST_DIR)
curl -sSfLk --get $(CODEMIRROR)/codemirror.min.js -z $(DIST_DIR)/codemirror.min.js -o $(DIST_DIR)/codemirror.min.js
curl -sSfLk --get $(CODEMIRROR)/codemirror.min.css -z $(DIST_DIR)/codemirror.min.css -o $(DIST_DIR)/codemirror.min.css
curl -sSfLk --get $(CODEMIRROR)/mode/clike/clike.min.js -z $(DIST_DIR)/clike.min.js -o $(DIST_DIR)/clike.min.js
curl -sSfLk --get https://raw.githubusercontent.com/codemirror/CodeMirror/master/LICENSE -z $(DIST_DIR)/codemirror.LICENSE -o $(DIST_DIR)/codemirror.LICENSE

dep: codemirror

codemirror: $(DIST_DIR)/codemirror.min.js
codemirror: $(DIST_DIR)/codemirror.min.css
codemirror: $(DIST_DIR)/codemirror.LICENSE
codemirror: $(DIST_DIR)/clike.min.js

$(DIST_DIR)/codemirror.min.js: dist_dir
[ -f $(DIST_DIR)/codemirror.min.js ] && : || \
curl -sSfLk --get $(CODEMIRROR)/codemirror.min.js \
-z $(DIST_DIR)/codemirror.min.js \
-o $(DIST_DIR)/codemirror.min.js

$(DIST_DIR)/codemirror.min.css: dist_dir
[ -f $(DIST_DIR)/codemirror.min.css ] && : || \
curl -sSfLk --get $(CODEMIRROR)/codemirror.min.css \
-z $(DIST_DIR)/codemirror.min.css \
-o $(DIST_DIR)/codemirror.min.css

$(DIST_DIR)/codemirror.LICENSE: dist_dir
[ -f $(DIST_DIR)/codemirror.LICENSE ] && : || \
curl -sSfLk --get https://raw.githubusercontent.com/codemirror/CodeMirror/master/LICENSE \
-z $(DIST_DIR)/codemirror.LICENSE \
-o $(DIST_DIR)/codemirror.LICENSE

$(DIST_DIR)/clike.min.js: dist_dir
[ -f $(DIST_DIR)/clike.min.js ] && : || \
curl -sSfLk --get $(CODEMIRROR)/mode/clike/clike.min.js \
-z $(DIST_DIR)/clike.min.js \
-o $(DIST_DIR)/clike.min.js

clean:
rm -rf $(BUILD_DIR)