Projecte

General

Perfil

« Anterior | Següent » 

Revisió ee446b02

Afegit per Jorge L. Florit fa casi 11 anys

Add script to select additional packages only in compile time

Visualitza les diferències:

Makefile
IMAGES = images
SHELL = bash
QMP_FEED = package/feeds/qmp_packages
COMMUNITY ?= qMp
SCRIPTS_DIR= scripts
COMMUNITY ?= qMp
EXTRA_PACKS =
J ?= 1
V ?= 0
T =
......
endef
define pre_build
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) PRE_BUILD $(TBUILD) $(TARGET)) )
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) PRE_BUILD $(TBUILD) $(TARGET) $(EXTRA_PACKS)) )
endef
define post_build
......
@[ -f $(IMAGES)/$(IM_NAME) ] || echo No output image configured in targets.mk
@echo $(IM_NAME)
$(if $(SYSUPGRADE),@echo $(SIM_NAME))
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) POST_BUILD $(TBUILD) $(TARGET)) )
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) POST_BUILD $(TBUILD) $(TARGET) $(EXTRA_PACKS)) )
@echo "qMp firmware compiled, you can find output files in $(IMAGES) directory."
endef
nightlycompile.sh
# Targets which are not gonna be compiled
NOTARGETS=${NOTARGETS:-}
# Extra packages (separated by spaces)
EXTRA_PACKS=${EXTRA_PACKS:-}
# If FORCE is 1, compilation process will be forced
[ -z "$FORCE" ] && FORCE=0
......
for t in $TARGETS; do
[[ "$NOTARGETS" =~ "$t" ]] && continue
echo "Compiling target $t"
nice -n 25 make T=$t build J=2 QMP_GIT_BRANCH=$BRANCH COMMUNITY=$COMMUNITY
nice -n 25 make T=$t build J=2 QMP_GIT_BRANCH=$BRANCH COMMUNITY=$COMMUNITY EXTRA_PACKS=$EXTRA_PACKS
[ $? -ne 0 ] && [ ! -z "$MAIL" ] &&
echo "Error detected during QMP compilation process" | mail -s "[qMp] build system" $MAIL
scripts/extra-packages.script
#!/bin/bash
PREPOST="$1"
shift
TBUILD="$1"
shift
shift
EXTRA_PACKS="$@"
FILE="build/$TBUILD/.config"
[ -z "$TBUILD" ] || [ ! -d "build/$TBUILD" ] || [ -f "$FILE" ] && exit 1
for i in $EXTRA_PACKS; do
[ "$PREPOST" = "PRE_BUILD" ] && AUX=$(grep $i $FILE) && sed -i -e s/"$AUX"/"CONFIG_PACKAGE_$i=y"/g $FILE
[ "$PREPOST" = "POST_BUILD" ] && AUX=$(grep $i $FILE) && sed -i -e s/"$AUX"/"# CONFIG_PACKAGE_$i is not set"/g $FILE
done

També disponible a: Unified diff