blob: 6a98dcab7aa37562dfe03f14046bfda88bdfb0d4 [file] [log] [blame]
Jan Kundrát5c6fbb72017-10-27 13:31:06 +02001#!/bin/bash
2
3if git rev-parse &> /dev/null; then
4 echo "Error: run this from a new build directory, not from within a git repo"
5 exit 1
6fi
7
8# Configure the local.mk with path to the individual repositories
9CZECHLIGHT_BR2_EXT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
10cat > local.mk <<EOF
Jan Kundráta4fbff22019-03-01 11:03:21 +010011DOCOPT_CPP_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/docopt.cpp
Jan Kundráta4fbff22019-03-01 11:03:21 +010012REPLXX_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/replxx
Jan Kundrátc901db02019-10-30 15:01:23 +010013CPPCODEC_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/cppcodec
Jan Kundrát2f100fc2020-11-02 22:10:16 +010014SDBUS_CPP_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/sdbus-cpp
15
Jan Kundráta4fbff22019-03-01 11:03:21 +010016LIBYANG_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/libyang
17SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/sysrepo
Jan Kundrát2f100fc2020-11-02 22:10:16 +010018HOST_SYSREPO_POST_RSYNC_HOOKS += HOST_SYSREPO_PATCH_USE_FAKE_DEV_SHM
Jan Kundráta4fbff22019-03-01 11:03:21 +010019LIBNETCONF2_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/libnetconf2
Jan Kundrát2f100fc2020-11-02 22:10:16 +010020NETOPEER2_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/Netopeer2
21
Jan Kundrát5c6fbb72017-10-27 13:31:06 +020022CLA_SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo
Jan Kundráta4fbff22019-03-01 11:03:21 +010023NETCONF_CLI_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/netconf-cli
Jan Kundrát623bf872019-10-23 18:37:36 +020024GAMMARUS_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/gammarus
Tomáš Peckac5897502020-07-13 16:49:28 +020025VELIA_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/velia
Tomáš Pecka785ceb32020-10-15 18:28:47 +020026LLDP_SYSTEMD_NETWORKD_SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/lldp-systemd-networkd-sysrepo
Jan Kundrát7a9d8b02020-02-05 23:03:00 +010027
28define CZECHLIGHT_GIT_FIX_GITDIR
29 echo "gitdir: \$\$(git rev-parse --resolve-git-dir \$(SRCDIR)/.git)" > \$(@D)/.git
30endef
31CLA_SYSREPO_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
32NETCONF_CLI_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
33GAMMARUS_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
Tomáš Peckac5897502020-07-13 16:49:28 +020034VELIA_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
Tomáš Pecka785ceb32020-10-15 18:28:47 +020035LLDP_SYSTEMD_NETWORKD_SYSREPO_POST_RSYNC_HOOKS += CZECHLIGHT_GIT_FIX_GITDIR
Jan Kundrát7a9d8b02020-02-05 23:03:00 +010036
Jan Kundrát5c6fbb72017-10-27 13:31:06 +020037EOF
38
39# We have to run make first so that the proxy Makefile is created and the BR2_EXTERNAL is remembered
40make O=$PWD -C ${CZECHLIGHT_BR2_EXT_LOC}/submodules/buildroot BR2_EXTERNAL=${CZECHLIGHT_BR2_EXT_LOC} outputmakefile