Add Makefile to build the firmware

We need an automated way to build our firmware. For example, it isn't
clear from this repository which version of gluon we're using.
This commit is contained in:
Franz Pletz
2014-11-08 23:48:37 +01:00
parent 8a715d5bd8
commit fdb0e57a3a
2 changed files with 26 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
gluon-build

25
Makefile Normal file
View File

@@ -0,0 +1,25 @@
GLUON_BUILD_DIR := gluon-build
GLUON_GIT_URL := git://github.com/freifunk-gluon/gluon.git
GLUON_GIT_REF := v2014.3.1
JOBS ?= $(shell cat /proc/cpuinfo | grep processor | wc -l)
_GIT_DESCRIBE = $(shell git describe --tags 2>&1)
ifneq (,${_GIT_DESCRIBE})
GLUON_RELEASE := ${_GIT_DESCRIBE}
endif
all: build
build: gluon-prepare
(cd ${GLUON_BUILD_DIR} && make update && make -j ${JOBS})
${GLUON_BUILD_DIR}:
git clone ${GLUON_GIT_URL} ${GLUON_BUILD_DIR}
gluon-prepare: ${GLUON_BUILD_DIR}
(cd ${GLUON_BUILD_DIR} && git checkout -q ${GLUON_GIT_REF})
ln -sfT .. ${GLUON_BUILD_DIR}/site
clean:
rm -rf ${GLUON_BUILD_DIR}