forked from adam-p/markdown-here
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (39 loc) · 1.45 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
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# Copyright Adam Pritchard 2014
# MIT License : http://adampritchard.mit-license.org/
#
PACKAGE_NAME = markdown-here
THUNDERBIRD_PACKAGE_NAME = $(PACKAGE_NAME)-thunderbird.xpi
CHROME_PACKAGE_NAME = $(PACKAGE_NAME)-chrome.zip
POSTBOX_PACKAGE_NAME = $(PACKAGE_NAME)-postbox.xpi
DIST_DIR = dist
SRC_DIR = src
TEST_DIR = $(SRC_DIR)/common/test
.PHONY: all dirs chrome postbox thunderbird clean
# Targets for creating directories
dirs: $(DIST_DIR)
rm -rf $(TEST_DIR)
$(DIST_DIR):
mkdir $(DIST_DIR)
chrome: | dirs
rm -f $(DIST_DIR)/$(CHROME_PACKAGE_NAME)
cd $(SRC_DIR); \
zip -r ../$(DIST_DIR)/$(CHROME_PACKAGE_NAME) manifest.json \
zip -r ../$(DIST_DIR)/$(CHROME_PACKAGE_NAME) common/* \
zip -r ../$(DIST_DIR)/$(CHROME_PACKAGE_NAME) chrome/*
thunderbird: | dirs
rm -f $(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME)
cd $(SRC_DIR); \
zip -r ../$(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME) chrome.manifest \
zip -r ../$(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME) install.rdf \
zip -r ../$(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME) common/* \
zip -r ../$(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME) firefox/*
postbox: thunderbird
cp -f $(DIST_DIR)/$(THUNDERBIRD_PACKAGE_NAME) $(DIST_DIR)/$(POSTBOX_PACKAGE_NAME)
cd $(SRC_DIR)/postbox; \
zip -r ../../$(DIST_DIR)/$(POSTBOX_PACKAGE_NAME) common/*
clean:
rm -rf $(DIST_DIR)
find . -name "desktop.ini" -or -name ".*" -and -not -name "." -and -not -name ".git*" -print0 | xargs -0 rm -rf
git checkout -- $(TEST_DIR)
all: clean chrome thunderbird