-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
44 lines (32 loc) · 1.04 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
PROJECT=theoldreader
SRC=source
TARGET=build
SOURCES = $(shell find $(SRC) -print)
# Preserve builds
.SECONDARY: $(TARGET)/chrome/ $(TARGET)/firefox/
all: chrome firefox
firefox: $(TARGET)/$(PROJECT)-firefox.xpi
chrome: $(TARGET)/$(PROJECT)-chrome.zip
$(TARGET)/$(PROJECT)-%.zip: $(TARGET)/%
@echo "\n*** Rebuilding $*.zip ***\n"
cd $(TARGET)/$* && zip -qr ../$(PROJECT)-$*.zip *
$(TARGET)/$(PROJECT)-%.xpi: $(TARGET)/%
@echo "\n*** Rebuilding $*.xpi ***\n"
cd $(TARGET)/$* && zip -qr ../$(PROJECT)-$*.xpi *
$(TARGET)/chrome: $(SOURCES)
@echo "\n*** Rebuilding chrome ***\n"
mkdir -p $@
rm -rf $(TARGET)/chrome/*
cp -r $(SRC)/* $@
mv $(TARGET)/chrome/manifest-chrome.json $(TARGET)/chrome/manifest.json
rm -f $(TARGET)/chrome/manifest-*.json
$(TARGET)/firefox: $(SOURCES)
@echo "\n*** Rebuilding firefox ***\n"
mkdir -p $@
rm -rf $(TARGET)/firefox/*
cp -r $(SRC)/* $@
mv $(TARGET)/firefox/manifest-firefox.json $(TARGET)/firefox/manifest.json
rm -f $(TARGET)/firefox/manifest-*.json
clean:
rm -rf $(TARGET)
.PHONY: all clean firefox chrome