2015-03-03 11:27:16 +01:00
|
|
|
GLUON_BUILD_DIR := gluon-build
|
2018-02-25 23:13:22 +01:00
|
|
|
GLUON_GIT_URL := https://github.com/freifunk-gluon/gluon
|
2023-09-08 12:04:10 +02:00
|
|
|
GLUON_GIT_REF := 4e2bd01d5f7ee1677d522e75c3818719e513eb01
|
2015-12-18 17:10:01 +01:00
|
|
|
|
2023-09-11 13:13:06 +02:00
|
|
|
PATCH_DIR := ./patches
|
|
|
|
|
2015-03-03 11:27:16 +01:00
|
|
|
SECRET_KEY_FILE ?= ${HOME}/.gluon-secret-key
|
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
GLUON_TARGETS ?= $(shell cat targets | tr '\n' ' ')
|
2019-12-08 01:17:54 +01:00
|
|
|
|
2015-04-17 14:44:06 +02:00
|
|
|
ifneq (,$(shell git describe --exact-match --tags 2>/dev/null))
|
2023-08-21 17:03:50 +02:00
|
|
|
GLUON_AUTOUPDATER_ENABLED := 1
|
|
|
|
GLUON_RELEASE := $(shell git describe --tags 2>/dev/null)
|
2015-03-03 11:27:16 +01:00
|
|
|
else
|
2023-08-21 17:03:50 +02:00
|
|
|
GLUON_AUTOUPDATER_ENABLED := 0
|
|
|
|
EXP_FALLBACK = $(shell date '+%Y%m%d')
|
|
|
|
BUILD_NUMBER ?= $(EXP_FALLBACK)
|
|
|
|
GLUON_RELEASE := $(shell git describe --tags)~exp$(BUILD_NUMBER)
|
2015-03-03 11:27:16 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
JOBS ?= $(shell cat /proc/cpuinfo | grep processor | wc -l)
|
2015-05-20 17:16:29 +02:00
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
GLUON_MAKE := ${MAKE} -j ${JOBS} -C ${GLUON_BUILD_DIR} \
|
|
|
|
GLUON_RELEASE=${GLUON_RELEASE} \
|
|
|
|
GLUON_AUTOUPDATER_BRANCH=${GLUON_AUTOUPDATER_BRANCH} \
|
|
|
|
GLUON_AUTOUPDATER_ENABLED=${GLUON_AUTOUPDATER_ENABLED}
|
2015-03-03 11:27:16 +01:00
|
|
|
|
2016-07-27 14:08:03 +02:00
|
|
|
|
2015-04-17 14:47:46 +02:00
|
|
|
all: info
|
2015-03-03 11:27:16 +01:00
|
|
|
${MAKE} manifest
|
2015-05-19 14:17:58 +02:00
|
|
|
|
2015-04-17 14:47:46 +02:00
|
|
|
info:
|
|
|
|
@echo
|
|
|
|
@echo '#########################'
|
2023-08-21 17:03:50 +02:00
|
|
|
@echo '# FFRGB Firmware build'
|
|
|
|
@echo '# Building release ${GLUON_RELEASE} for branch ${GLUON_AUTOUPDATER_BRANCH}'
|
2015-05-19 14:17:58 +02:00
|
|
|
@echo
|
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
build: gluon-prepare output-clean
|
2015-05-19 14:17:58 +02:00
|
|
|
for target in ${GLUON_TARGETS}; do \
|
|
|
|
echo ""Building target $$target""; \
|
2023-08-21 17:03:50 +02:00
|
|
|
${GLUON_MAKE} download all GLUON_TARGET="$$target"; \
|
2015-12-30 18:25:55 +01:00
|
|
|
done
|
2015-12-18 16:52:02 +01:00
|
|
|
|
2015-03-03 11:27:16 +01:00
|
|
|
manifest: build
|
2023-08-21 17:03:50 +02:00
|
|
|
for branch in next experimental testing stable; do \
|
|
|
|
${GLUON_MAKE} manifest GLUON_AUTOUPDATER_BRANCH=$$branch;\
|
|
|
|
done
|
|
|
|
mv -f ${GLUON_BUILD_DIR}/output/* ./output/
|
2015-03-03 11:27:16 +01:00
|
|
|
|
|
|
|
sign: manifest
|
2023-08-21 17:03:50 +02:00
|
|
|
${GLUON_BUILD_DIR}/contrib/sign.sh ${SECRET_KEY_FILE} output/images/sysupgrade/${GLUON_AUTOUPDATER_BRANCH}.manifest
|
2015-03-03 11:27:16 +01:00
|
|
|
|
|
|
|
${GLUON_BUILD_DIR}:
|
2023-08-21 17:03:50 +02:00
|
|
|
mkdir -p ${GLUON_BUILD_DIR}
|
|
|
|
|
|
|
|
# Note: "|" means "order only", e.g. "do not care about folder timestamps"
|
|
|
|
# https://www.gnu.org/savannah-checkouts/gnu/make/manual/html_node/Prerequisite-Types.html
|
|
|
|
${GLUON_BUILD_DIR}/.git: | ${GLUON_BUILD_DIR}
|
|
|
|
git init ${GLUON_BUILD_DIR}
|
|
|
|
cd ${GLUON_BUILD_DIR} && git remote add origin ${GLUON_GIT_URL}
|
|
|
|
|
|
|
|
gluon-update: | ${GLUON_BUILD_DIR}/.git
|
|
|
|
cd ${GLUON_BUILD_DIR} && git fetch --tags origin ${GLUON_GIT_REF}
|
|
|
|
cd ${GLUON_BUILD_DIR} && git reset --hard FETCH_HEAD
|
|
|
|
cd ${GLUON_BUILD_DIR} && git clean -fd
|
2015-03-03 11:27:16 +01:00
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
gluon-prepare: gluon-update
|
2023-09-11 13:13:06 +02:00
|
|
|
make gluon-patch
|
2015-03-03 11:27:16 +01:00
|
|
|
ln -sfT .. ${GLUON_BUILD_DIR}/site
|
|
|
|
${GLUON_MAKE} update
|
|
|
|
|
2023-09-11 13:13:06 +02:00
|
|
|
gluon-patch:
|
|
|
|
scripts/apply_patches.sh ${GLUON_BUILD_DIR} ${PATCH_DIR}
|
|
|
|
|
2015-03-03 11:27:16 +01:00
|
|
|
gluon-clean:
|
|
|
|
rm -rf ${GLUON_BUILD_DIR}
|
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
output-clean:
|
|
|
|
mkdir -p output/
|
|
|
|
rm -rf output/*
|
2015-03-03 11:27:16 +01:00
|
|
|
|
2023-08-21 17:03:50 +02:00
|
|
|
clean: gluon-clean output-clean
|