-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
35 lines (27 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SRC_ICON = copyclipper.png
ICONS=icon128.png icon48.png icon16.png
ZIP_EXCLUDE= .git* $(SRC_ICON) screenshot*.png Makefile README.md \
node_modules/* package.json dist/* .DS_Store *.xcf \
copyclipperrc *.py *.pyc
JSON_FILES = manifest.json
JS_FILES = background.js options.js popup.js sendto.js
space :=
space +=
ZIP_EXCLUDE_FLAGS = --exclude=$(subst $(space),$(space)--exclude=,$(ZIP_EXCLUDE))
build: setup $(wildcard **/*) $(ICONS) $(JSON_FILES) $(JS_FILES)
dirname=$(shell basename $(PWD)); zip -r $(ZIP_EXCLUDE_FLAGS) dist/$$dirname.zip . $(ZIP_INCLUDES)
clean:
rm -fv $(ICONS)
rm -rf node_modules/ vendor/ dist/
dirname=$(shell basename $(PWD)); rm -fv dist/$$dirname.zip
icon%.png: $(SRC_ICON)
convert $(SRC_ICON) -resize $* $@
dist:
mkdir -v dist
setup: dist
python:
if ! type -f terminal-notifier; then brew install terminal-notifier; fi
if ! python -c "import AppKit"; then \
sudo -H easy_install -U pyobjc-core; sudo -H easy_install -U pyobjc; fi
if [ ! -r ~/.copyclipperrc ]; then D="$$PWD/copyclipperrc"; cd ~; ln -s "$$D" .copyclipperrc; fi
python -m unittest -f test_copyclipper