forked from DerDerwish/site-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.3 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
49
50
51
52
53
GLUON_BUILD_DIR := gluon-build
GLUON_GIT_URL := git://github.com/freifunk-gluon/gluon.git
GLUON_GIT_REF := v2014.4
SECRET_KEY_FILE ?= ${HOME}/.gluon-secret-key
_GIT_DESCRIBE = $(shell git describe --tags 2>/dev/null)
ifneq (,${_GIT_DESCRIBE})
GLUON_RELEASE := ${_GIT_DESCRIBE}
GLUON_BRANCH := stable
else
GLUON_RELEASE ?= snapshot~$(shell date '+%Y%m%d')~$(shell git describe --always)
GLUON_BRANCH := experimental
endif
JOBS ?= $(shell cat /proc/cpuinfo | grep processor | wc -l)
GLUON_MAKE := ${MAKE} -j ${JOBS} -C ${GLUON_BUILD_DIR} \
GLUON_RELEASE=${GLUON_RELEASE} \
GLUON_BRANCH=${GLUON_BRANCH}
all: gluon-clean
${MAKE} manifest
${MAKE} gluon-clean
build: gluon-prepare
${GLUON_MAKE}
images: build
${MAKE} images-clean
mv ${GLUON_BUILD_DIR}/images .
manifest: images
${GLUON_MAKE} manifest
sign: gluon-prepare manifest
${GLUON_BUILD_DIR}/contrib/sign.sh ${SECRET_KEY_FILE} images/sysupgrade/${GLUON_BRANCH}.manifest
${GLUON_BUILD_DIR}:
git clone ${GLUON_GIT_URL} ${GLUON_BUILD_DIR}
gluon-prepare: ${GLUON_BUILD_DIR}
(cd ${GLUON_BUILD_DIR} && git fetch origin && git checkout -q ${GLUON_GIT_REF})
ln -sfT .. ${GLUON_BUILD_DIR}/site
${GLUON_MAKE} update
gluon-clean:
rm -rf ${GLUON_BUILD_DIR}
images-clean:
rm -rf images
clean: gluon-clean images-clean