Projecte

General

Perfil

Baixar (13.8 KB) Estadístiques
| Branca: | Etiqueta: | Revisió:
7ee8f8a1 Roger Pueyo Centelles
# [qMp] firmware generator (http://qmp.cat)
4ecdf50f Roger Pueyo Centelles
# Copyright (C) 2011-2016 Routek S.L. (http://routek.net)
2aaa878f Simó Albert i Beltran
#
7ee8f8a1 Roger Pueyo Centelles
# This program is free software: you can redistribute it and/or modify
e518a2c2 Pau
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
7ee8f8a1 Roger Pueyo Centelles
# Contributors:
165e8b21 Roger Pueyo Centelles
# Pau Escrich <p4u@dabax.net>
# Simó Albert i Beltran
# Agustí Moll
# Roger Pueyo Centelles
e518a2c2 Pau
941ebf1c Roger Pueyo Centelles
# Base distribution sources clone URLs
5e69c77a Roger Pueyo Centelles
LEDE_SOURCE_CLONE = git clone -b lede-17.01 http://git.lede-project.org/source.git
LEDE_PKG_CLONE = git clone -b lede-17.01 https://git.lede-project.org/feed/packages.git
7ee8f8a1 Roger Pueyo Centelles
941ebf1c Roger Pueyo Centelles
# qMp packages source clone URLs and settings
b3a6b31b Roger Pueyo Centelles
QMP_GIT_RW = ssh://gitolite@dev.qmp.cat:qmp.git
13f11775 Roger Pueyo Centelles
QMP_GIT_RO = http://dev.qmp.cat/qmp.git
92e4657a Roger Pueyo Centelles
QMP_GIT_BRANCH ?= 4.0
7ee8f8a1 Roger Pueyo Centelles
QMP_FEED = package/feeds/qmp_packages

941ebf1c Roger Pueyo Centelles
# Distribution naming
VERSION_DIST ?= qMp
VERSION_MANUFACTURER ?= "Quick Mesh Project"
VERSION_MANUFACTURER_URL ?= https://www.qmp.cat
VERSION_BUG_URL ?= https://dev.qmp.cat/projects/qmp/issues
VERSION_SUPPORT_URL ?= https://dev.qmp.cat/projects/qmp/wiki

# Distribution versioning (e.g. Ratafia 2.0, Clearance testing, Kalimotxo trunk)
92e4657a Roger Pueyo Centelles
VERSION_NICK ?= Macondo
VERSION_NUMBER ?= 4.0-rc1
941ebf1c Roger Pueyo Centelles
# Distribution repository
VERSION_REPO="http://fw.qmp.cat/Releases/%v-%N"

# Image customization
IMAGEOPT ?= true
VERSIONOPT ?= true
EXTRA_PACKAGES ?=
QMP_COMMUNITY ?=
DISTCL = `echo $(VERSION_DIST) | tr A-Z a-z`

#Compilation options
J ?= 1
V ?= 0
TBUILD ?= lede
e518a2c2 Pau
BUILD_DIR = build
CONFIG_DIR = configs
MY_CONFIGS = $(BUILD_DIR)/configs
7eff0866 p4u
IMAGES = images
e518a2c2 Pau
SHELL = bash
1209afe3 p4u
SCRIPTS_DIR= scripts
884b8141 Agustí Moll Garcia
MAKE_SRC = -j$(J) V=$(V)
7ee8f8a1 Roger Pueyo Centelles
7eff0866 p4u
9a8d0b07 Roger Pueyo Centelles
include targets.mk
e518a2c2 Pau
e4de91ec Roger Pueyo Centelles
TIMESTAMP = $(shell date +%Y%m%d-%H%M)
6b5e8a5c p4u
cce89d3e p4u
#Checking if developer mode is enabled and if target is defined before
8be67335 p4u
$(eval $(if $(DEV),QMP_GIT=$(QMP_GIT_RW),QMP_GIT=$(QMP_GIT_RO)))
0a1f5a1f p4u
#Define TARGET_CONFIGS and TARGET
$(eval $(if $(TARGET_MASTER),TARGET_CONFIGS=$(TARGET_MASTER),TARGET_CONFIGS=$(T)))
6ae72a25 Roger Pueyo Centelles
$(eval $(if $(T),,TARGET_CONFIGS=$(MPT)))
ff488f02 p4u
$(eval $(if $(TARGET),,TARGET=$(T)))
4ecdf50f Roger Pueyo Centelles
$(eval $(if $(MPTARGET),,MPTARGET=$(MPT)))
ff488f02 p4u
0a1f5a1f p4u
#Define BUILD_PATH based on TBUILD (defined in targets.mk)
$(eval $(if $(TBUILD),,TBUILD=$(TARGET)))
BUILD_PATH=$(BUILD_DIR)/$(TBUILD)

17fd4110 Pau Escrich
#Getting output image paths and names
2c86914a Roger Pueyo Centelles
EXT4IMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(EXT4IMAGE) | awk '{print $$1}')
EXT4IMAGE_NAME := $(shell echo $(EXT4IMAGE) | awk '{print $$2}')
FACTORY_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(FACTORY) | awk '{print $$1}')
FACTORY_NAME := $(shell echo $(FACTORY) | awk '{print $$2}')
SQUASHIMAGE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(SQUASHIMAGE) | awk '{print $$1}')
SQUASHIMAGE_NAME := $(shell echo $(SQUASHIMAGE) | awk '{print $$2}')
SYSUPGRADE_PATH := $(shell echo bin/targets/$(ARCH)/$(SUBARCH)/$(SYSUPGRADE) | awk '{print $$1}')
SYSUPGRADE_NAME := $(shell echo $(SYSUPGRADE) | awk '{print $$2}')
884b8141 Agustí Moll Garcia
0a1f5a1f p4u
CONFIG = $(BUILD_PATH)/.config
KCONFIG = $(BUILD_PATH)/target/linux/$(ARCH)/config-*
3ba6af84 p4u
9a8d0b07 Roger Pueyo Centelles
.PHONY: checkout clean clean_qmp compile config kernel_menuconfig menuconfig list_archs list_targets post_build pre_build update
0a1f5a1f p4u
e518a2c2 Pau
define build_src
a80183bc p4u
$(eval REV_GIT=$(shell git --git-dir=$(BUILD_DIR)/qmp/.git --no-pager log -n 1 --oneline|cut -d " " -f 1))
889ae324 Roger Pueyo Centelles
@if [ ! $(REBUILD) -a $(MPNAME) -a -f .build_src_$(ARCH)-$(SUBARCH) ]; then \
echo Multi-profile target $(ARCH)-$(SUBARCH) already compiled; \
else \
echo Compiling multi-profile target $(ARCH)-$(SUBARCH); \
941ebf1c Roger Pueyo Centelles
make -C $(BUILD_PATH) $(MAKE_SRC) IMAGEOPT=$(IMAGEOPT) VERSIONOPT=$(VERSIONOPT) VERSION_REPO=$(VERSION_REPO) VERSION_DIST=$(VERSION_DIST) VERSION_NICK=$(VERSION_NICK) VERSION_NUMBER=$(VERSION_NUMBER) VERSION_MANUFACTURER=$(VERSION_MANUFACTURER) VERSION_MANUFACTURER_URL=$(VERSION_MANUFACTURER_URL) VERSION_BUG_URL=$(VERSION_BUG_URL) VERSION_SUPPORT_URL=$(VERSION_SUPPORT_URL) BRANCH_GIT=$(QMP_GIT_BRANCH) REV_GIT=$(REV_GIT) QMP_CODENAME=$(VERSION_NICK) QMP_RELEASE=$(VERSION_NUMBER); \
889ae324 Roger Pueyo Centelles
touch .build_src_$(ARCH)-$(SUBARCH); \
fi

e518a2c2 Pau
endef

9a2c8510 p4u
define copy_feeds_file
f9c1e894 p4u
$(if $(1),$(eval FEEDS_DIR=$(1)),$(eval FEEDS_DIR=$(TBUILD)))
3e5ebc19 Roger Pueyo Centelles
$(if $(FEEDS_DIR),,$(call target_error))
cp -f $(BUILD_DIR)/$(FEEDS_DIR)/feeds.conf.default $(BUILD_DIR)/$(FEEDS_DIR)/feeds.conf
cat $(BUILD_DIR)/qmp/feeds.conf >> $(BUILD_DIR)/$(FEEDS_DIR)/feeds.conf
f9c1e894 p4u
sed -i -e "s|PATH|`pwd`/$(BUILD_DIR)|" $(BUILD_DIR)/$(FEEDS_DIR)/feeds.conf
9a2c8510 p4u
endef

e518a2c2 Pau
define checkout_src
973bac34 Roger Pueyo Centelles
$(LEDE_SOURCE_CLONE) $(BUILD_PATH)
a1fb6e5b Simó Albert i Beltran
mkdir -p dl
0a1f5a1f p4u
ln -fs ../../dl $(BUILD_PATH)/dl
ln -fs ../qmp/files $(BUILD_PATH)/files
99db01bf Simó Albert i Beltran
ln -fs $(BUILD_DIR)/qmp/files
0a1f5a1f p4u
rm -rf $(BUILD_PATH)/feeds/
f9c1e894 p4u
$(call copy_feeds_file,$(TBUILD))
b9208096 p4u
endef

b3a6b31b Roger Pueyo Centelles
define checkout_lede_pkg_override
973bac34 Roger Pueyo Centelles
$(LEDE_PKG_CLONE) $(BUILD_DIR)/packages.$(TARGET)
0a1f5a1f p4u
sed -i -e "s|src-link packages .*|src-link packages `pwd`/$(BUILD_DIR)/packages.$(TARGET)|" $(BUILD_PATH)/feeds.conf
6f755fd4 p4u
endef

b9208096 p4u
define copy_config
6ae72a25 Roger Pueyo Centelles
$(if $(T), $(call copy_config_target),$(call copy_config_mptarget))
9a8d0b07 Roger Pueyo Centelles
endef

define copy_config_mptarget
$(if $(T),@echo "Using multi-profile $(ARCH)-$(SUBARCH) for target $(T)", @echo "Using multi-profile $(MPT)")

59b4c27e Roger Pueyo Centelles
@cp -f $(CONFIG_DIR)/$(ARCH)-$(SUBARCH)-multiprofile $(CONFIG) || echo "WARNING: Config file not found!"
d49aad23 Roger Pueyo Centelles
@echo "Adding qMp packages to targets:"
9a8d0b07 Roger Pueyo Centelles
@for DEVICE in $(TINY); do \
d49aad23 Roger Pueyo Centelles
echo "Adding qMp tiny package to targets:" ;\
echo $(DEVPKG)$$DEVICE=\"$(TINYPKG)\" $(CONFIG) ;\
9a8d0b07 Roger Pueyo Centelles
echo $(DEVPKG)$$DEVICE=\"$(TINYPKG)\" >> $(CONFIG) ;\
done
@for DEVICE in $(SMALL); do \
d49aad23 Roger Pueyo Centelles
echo "Adding qMp small package to targets:" ;\
echo $(DEVPKG)$$DEVICE=\"$(SMALLPKG)\" $(CONFIG) ;\
9a8d0b07 Roger Pueyo Centelles
echo $(DEVPKG)$$DEVICE=\"$(SMALLPKG)\" >> $(CONFIG) ; \
done
@for DEVICE in $(BIG); do \
d49aad23 Roger Pueyo Centelles
echo "Adding qMp big package to targets:" ;\
echo $(DEVPKG)$$DEVICE=\"$(BIGPKG)\" $(CONFIG) ;\
9a8d0b07 Roger Pueyo Centelles
echo $(DEVPKG)$$DEVICE=\"$(BIGPKG)\" >> $(CONFIG) ; \
done
92b6b927 p4u
cd $(BUILD_PATH) && make defconfig
endef

9a8d0b07 Roger Pueyo Centelles
define copy_config_target
@echo "Using target $(T)"

@#If the target is part of a multi-profile target, then switch to multi-profile compilation
$(if $(MPNAME), \
889ae324 Roger Pueyo Centelles
@echo "Target $(T) is part of multi-profile target $(ARCH)-$(SUBARCH)"
9a8d0b07 Roger Pueyo Centelles
$(call copy_config_mptarget), \
53cfc1c5 Roger Pueyo Centelles
@echo "Target $(T) is not part of a multi-profile target"
@cp -f $(CONFIG_DIR)/$(PROFILE) $(CONFIG) || echo "WARNING: Config file not found!"; \
[ -f $(CONFIG_DIR)/targets/$(TARGET) ] && cat $(CONFIG_DIR)/targets/$(TARGET) >> $(CONFIG) || true; \
9a8d0b07 Roger Pueyo Centelles
cd $(BUILD_PATH) && make defconfig)
endef

92b6b927 p4u
define copy_config_obsolete
0a1f5a1f p4u
@echo "Syncronizing new configuration"
cp -f $(CONFIG_DIR)/$(TARGET_CONFIGS)/config $(CONFIG) || echo "WARNING: Config file not found!"
cd $(BUILD_PATH) && ./scripts/diffconfig.sh > .config.tmp
cp -f $(BUILD_PATH)/.config.tmp $(BUILD_PATH)/.config
cd $(BUILD_PATH) && make defconfig
53cfc1c5 Roger Pueyo Centelles
-@if [ -f $(CONFIG_DIR)/$(TARGET_CONFIGS)/kernel_config ]; then cat $(CONFIG_DIR)/$(TARGET_CONFIGS)/kernel_config >> $(CONFIG); fi
e518a2c2 Pau
endef

0a1f5a1f p4u
define copy_myconfig
@echo "Syncronizing configuration from previous one"
@cp -f $(MY_CONFIGS)/$(TARGET_CONFIGS)/config $(CONFIG) || echo "WARNING: Config file not found in $(MY_CONFIGS)!"
53cfc1c5 Roger Pueyo Centelles
-@if [ -f $(CONFIG_DIR)/$(TARGET_CONFIGS)/kernel_config ]; then cat $(CONFIG_DIR)/$(TARGET_CONFIGS)/kernel_config >> $(CONFIG); fi
0a1f5a1f p4u
endef

e518a2c2 Pau
define update_feeds
e4a024c9 p4u
@echo "Updating feed $(1)"
./$(BUILD_DIR)/$(1)/scripts/feeds update -a
4ecdf50f Roger Pueyo Centelles
e4a024c9 p4u
./$(BUILD_DIR)/$(1)/scripts/feeds install -a
e518a2c2 Pau
endef

define menuconfig_owrt
0a1f5a1f p4u
make -C $(BUILD_PATH) menuconfig
0d714430 Roger Pueyo Centelles
$(if $(T), mkdir -p $(MY_CONFIGS)/$(TARGET),mkdir -p $(MY_CONFIGS)/$(MPTARGET))
$(if $(T), cp -f $(CONFIG) $(MY_CONFIGS)/$(TARGET)/config, cp -f $(CONFIG) $(MY_CONFIGS)/$(MPTARGET)/config)
e518a2c2 Pau
endef

define kmenuconfig_owrt
0a1f5a1f p4u
make -C $(BUILD_PATH) kernel_menuconfig
a88f4272 Simó Albert i Beltran
mkdir -p $(MY_CONFIGS)/$(TARGET)
ff488f02 p4u
cp -f $(KCONFIG) $(MY_CONFIGS)/$(TARGET)/kernel_config
7eff0866 p4u
endef

1209afe3 p4u
define pre_build
0bbc22a4 Jorge L. Florit
@echo "Executing PRE_BUILD scripts"
941ebf1c Roger Pueyo Centelles
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) PRE_BUILD $(TBUILD) $(TARGET) $(EXTRA_PACKAGESS)) )
1209afe3 p4u
endef

7eff0866 p4u
define post_build
889ae324 Roger Pueyo Centelles
$(if $(T), $(call post_build_target))
endef

define post_build_target
f0c4159f Roger Pueyo Centelles
$(if $(QMP_COMMUNITY),$(if $(EXT4IMAGE_NAME),,$(eval EXT4IMAGE_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)_$(NAME)_ext4_$(TIMESTAMP).$(BINEXT))),$(if $(EXT4IMAGE_NAME),,$(eval EXT4IMAGE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)_$(NAME)_ext4_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(FACTORY_NAME),,$(eval FACTORY_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)_$(NAME)_factory_$(TIMESTAMP).$(BINEXT))),$(if $(FACTORY_NAME),,$(eval FACTORY_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)_$(NAME)_factory_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(SQUASHIMAGE_NAME),,$(eval SQUASHIMAGE_NAME=$(VERSION_DIST)-$(QMP_COMMUNITY)_$(VERSION_NUMBER)_$(NAME)_squashfs_$(TIMESTAMP).$(BINEXT))),$(if $(SQUASHIMAGE_NAME),,$(eval SQUASHIMAGE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)_$(NAME)_squashfs_$(TIMESTAMP).$(BINEXT))))
$(if $(QMP_COMMUNITY),$(if $(SYSUPGRADE_NAME),,$(eval SYSUPGRADE_NAME=$(VERSION_DIST)-$(COMMUNITY)_$(VERSION_NUMBER)_$(NAME)_sysupgrade_$(TIMESTAMP).$(BINEXT))),$(if $(SYSUPGRADE_NAME),,$(eval SYSUPGRADE_NAME=$(VERSION_DIST)_$(VERSION_NUMBER)_$(NAME)_sysupgrade_$(TIMESTAMP).$(BINEXT))))
2c86914a Roger Pueyo Centelles
a1fb6e5b Simó Albert i Beltran
mkdir -p $(IMAGES)
2c86914a Roger Pueyo Centelles
-@[ -f $(BUILD_PATH)/$(EXT4IMAGE_PATH) ] && cp -f $(BUILD_PATH)/$(EXT4IMAGE_PATH) $(IMAGES)/$(EXT4IMAGE_NAME)
-@[ -f $(BUILD_PATH)/$(FACTORY_PATH) ] && cp -f $(BUILD_PATH)/$(FACTORY_PATH) $(IMAGES)/$(FACTORY_NAME)
-@[ -f $(BUILD_PATH)/$(SQUASHIMAGE_PATH) ] && cp -f $(BUILD_PATH)/$(SQUASHIMAGE_PATH) $(IMAGES)/$(SQUASHIMAGE_NAME)
-@[ -f $(BUILD_PATH)/$(SYSUPGRADE_PATH) ] && cp -f $(BUILD_PATH)/$(SYSUPGRADE_PATH) $(IMAGES)/$(SYSUPGRADE_NAME)
@[ -f $(IMAGES)/$(EXT4IMAGE_NAME) -o -f $(IMAGES)/$(FACTORY_NAME) -o -f $(IMAGES)/$(SQUASHIMAGE_NAME) -o -f $(IMAGES)/$(SYSUPGRADE_NAME) ] || echo No output image configured in targets.mk

@echo "Generated images:"
$(if $(EXT4IMAGE),@echo $(EXT4IMAGE_NAME))
$(if $(FACTORY),@echo $(FACTORY_NAME))
$(if $(SQUASHIMAGE),@echo $(SQUASHIMAGE_NAME))
$(if $(SYSUPGRADE),@echo $(SYSUPGRADE_NAME))

0bbc22a4 Jorge L. Florit
@echo "Executing POST_BUILD scripts"
941ebf1c Roger Pueyo Centelles
$(foreach SCRIPT, $(wildcard $(SCRIPTS_DIR)/*.script), $(shell $(SCRIPT) POST_BUILD $(TBUILD) $(TARGET) $(EXTRA_PACKAGESS)) )
cce89d3e p4u
@echo "qMp firmware compiled, you can find output files in $(IMAGES) directory."
e518a2c2 Pau
endef

define clean_all
a88f4272 Simó Albert i Beltran
rm -rf $(BUILD_DIR)/*
rm -f .checkout_*
4f79348d Jorge L. Florit
rm -f $(IMAGES)/*.bin $(IMAGES)/IMAGES
e518a2c2 Pau
endef

define clean_target
1427a83c Simó Albert i Beltran
-rm -rf $(BUILD_PATH)
-rm -f .checkout_$(TBUILD)
-rm -rf $(BUILD_DIR)/packages.$(TARGET)
b3a6b31b Roger Pueyo Centelles
rm -f .checkout_lede_pkg_override_$(TARGET)
e518a2c2 Pau
endef

dbd4db87 p4u
define clean_pkg
echo "Cleaning package $1"
2aaa878f Simó Albert i Beltran
make $1/clean
dbd4db87 p4u
endef

e518a2c2 Pau
define target_error
9a8d0b07 Roger Pueyo Centelles
@echo "You must specify either a single target, using the T variable (e.g.: make T=alix build),"
@echo "or a multi-profile target, using the MPT variable (e.g.: make MPT=ar71xx-generic build),"
@echo ""
e518a2c2 Pau
@echo "To see avialable targets run: make list_targets"
9a8d0b07 Roger Pueyo Centelles
@echo "To see avialable multi-profile target run: make list_mptargets"
e518a2c2 Pau
@exit 1
endef

7f54166f Simó Albert i Beltran
define get_git_local_revision
git rev-parse origin/$1
endef

define get_git_remote_revision
git ls-remote origin $1 | awk 'NR==1{print $$1}'
endef

9f3a2bdf p4u
all: build

e518a2c2 Pau
.checkout_qmp:
git clone $(QMP_GIT) $(BUILD_DIR)/qmp
b4656cb9 Agustí Moll Garcia
cd $(BUILD_DIR)/qmp; git checkout $(QMP_GIT_BRANCH); cd ..
7eff0866 p4u
@touch $@
e518a2c2 Pau
b3a6b31b Roger Pueyo Centelles
.checkout_lede_pkg:
973bac34 Roger Pueyo Centelles
$(LEDE_PKG_CLONE) $(BUILD_DIR)/packages
ca89f12f Agustí Moll Garcia
@touch $@

b3a6b31b Roger Pueyo Centelles
.checkout_lede_pkg_override:
$(if $(filter $(origin LEDE_PKG_CLONE),override),$(if $(wildcard .checkout_lede_pkg_override_$(TARGET)),,$(call checkout_lede_pkg_override)),)
@touch .checkout_lede_pkg_override_$(TARGET)
6f755fd4 p4u
b3a6b31b Roger Pueyo Centelles
.checkout_lede:
0a1f5a1f p4u
$(if $(TBUILD),,$(call target_error))
$(if $(wildcard .checkout_$(TBUILD)),,$(call checkout_src))
6f755fd4 p4u
b3a6b31b Roger Pueyo Centelles
checkout: .checkout_qmp .checkout_lede .checkout_lede_pkg .checkout_lede_pkg_override
0a1f5a1f p4u
$(if $(wildcard .checkout_$(TBUILD)),,$(call update_feeds,$(TBUILD)))
9a8d0b07 Roger Pueyo Centelles
$(if $(wildcard .checkout_$(TBUILD)),,$(call copy_config))
0a1f5a1f p4u
@touch .checkout_$(TBUILD)
8fee292e p4u
sync_config:
9a8d0b07 Roger Pueyo Centelles
$(if $(MPTARGET)$(TARGET),,$(call target_error))
6ae72a25 Roger Pueyo Centelles
$(if $(wildcard $(MY_CONFIGS)/$(TARGET_CONFIGS)), $(call copy_myconfig),$(call copy_config))
2aaa878f Simó Albert i Beltran
b3a6b31b Roger Pueyo Centelles
update: .checkout_lede_pkg .checkout_lede_pkg_override .checkout_qmp
f9c1e894 p4u
$(if $(TBUILD),,$(call target_error))
e518a2c2 Pau
cd $(BUILD_DIR)/qmp && git pull
9a2c8510 p4u
$(call copy_feeds_file)
e4a024c9 p4u
b3a6b31b Roger Pueyo Centelles
update_all: .checkout_lede_pkg .checkout_lede_pkg_override .checkout_qmp
f9c1e894 p4u
@echo Updating qMp repository
cd $(BUILD_DIR)/qmp && git pull
@echo Updating feeds config files
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call copy_feeds_file,$(dir))))
@echo Updating feeds
$(foreach dir,$(TBUILD_LIST),$(if $(wildcard $(BUILD_DIR)/$(dir)),$(call update_feeds,$(dir))))
e518a2c2 Pau
9a2c8510 p4u
update_feeds: update
$(call update_feeds,$(TBUILD))

0a1f5a1f p4u
menuconfig: checkout sync_config
6b5e8a5c p4u
$(call menuconfig_owrt)
2aaa878f Simó Albert i Beltran
0a1f5a1f p4u
kernel_menuconfig: checkout sync_config
6b5e8a5c p4u
$(call kmenuconfig_owrt)
e518a2c2 Pau
clean:
ff488f02 p4u
$(if $(TARGET),$(call clean_target),$(call clean_all))
e518a2c2 Pau
dbd4db87 p4u
clean_qmp:
0a1f5a1f p4u
cd $(BUILD_PATH) ; \
dbd4db87 p4u
for d in $(QMP_FEED)/*; do make $$d/clean ; done

1209afe3 p4u
post_build: checkout
b3a6b31b Roger Pueyo Centelles
$(call post_build)
cce89d3e p4u
1209afe3 p4u
pre_build: checkout
$(call pre_build)

0bbc22a4 Jorge L. Florit
compile: checkout
b5640dd0 Roger Pueyo Centelles
$(if $(MPTARGET),$(call build_src),$(call build_src))
0bbc22a4 Jorge L. Florit
e518a2c2 Pau
list_targets:
7eff0866 p4u
$(info $(HW_AVAILABLE))
@exit 0
e518a2c2 Pau
b3a6b31b Roger Pueyo Centelles
list_mptargets:
9a8d0b07 Roger Pueyo Centelles
$(info $(MP_AVAILABLE))
b3a6b31b Roger Pueyo Centelles
@exit 0

b2e7591a Jorge L. Florit
target_name:
$(info $(NAME))
@exit 0

e518a2c2 Pau
config:
1209afe3 p4u
@select HW in $(HW_AVAILABLE); do break; done; echo $$HW > .config.tmp;
2aaa878f Simó Albert i Beltran
mv .config.tmp .config
e518a2c2 Pau
8be67335 p4u
help:
1427a83c Simó Albert i Beltran
-cat README | more
8be67335 p4u
0bbc22a4 Jorge L. Florit
build: checkout sync_config pre_build compile post_build
4f190dbb Jorge L. Florit
7f54166f Simó Albert i Beltran
is_up_to_date:
cd $(BUILD_DIR)/qmp && test "$$($(call get_git_local_revision,$(QMP_GIT_BRANCH)))" == "$$($(call get_git_remote_revision,$(QMP_GIT_BRANCH)))"