-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·27 lines (20 loc) · 869 Bytes
/
Copy pathMakefile
File metadata and controls
executable file
·27 lines (20 loc) · 869 Bytes
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
EXTDIR := ext/
BUILDDIR := build/
NAME := $(shell sed -nre 's/.*em:name="(.+?)".*/\1/p;' ${EXTDIR}/install.rdf | head -n1)
ID := $(shell sed -nre 's/.*em:id="(.+?)".*/\1/p;' ${EXTDIR}/install.rdf | head -n1)
VERSION := $(shell sed -nre 's/.*em:version="(.+?)".*/\1/p;' ${EXTDIR}/install.rdf | head -n1)
FILES := $(shell find ${EXTDIR}/ -type f)
FNAME := $(shell echo ${NAME} | sed -re "s/[/ :]//g")
XPI := $(addprefix ${BUILDDIR},${FNAME}_${VERSION}.xpi)
IDFILE := $(addprefix ${BUILDDIR},${ID})
.PHONY : clean all id
all: ${XPI} ${IDFILE}
id: ${IDFILE}
${XPI}: ${FILES}
mkdir -p ${BUILDDIR}
rm -f "$@"
cd ${EXTDIR} && zip -1 -r -x\*.bak "../$@" *
${IDFILE}: ${EXTDIR}/install.rdf
(which cygpath >/dev/null 2>&1 && cygpath -aw ${EXTDIR} || echo `pwd`/${EXTDIR}) > $(addprefix ${BUILDDIR}, ${ID})
clean:
rm -rf ${BUILDDIR}