NetworkManager/tools/test-build.sh
Thomas Haller ac1a9e03e4
all: move "src/" directory to "src/core/"
Currently "src/" mostly contains the source code of the daemon.
I say mostly, because that is not true, there are also the device,
settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp
helper, and probably more.

Also we have source code under libnm-core/, libnm/, clients/, and
shared/ directories. That is all confusing.

We should have one "src" directory, that contains subdirectories. Those
subdirectories should contain individual parts (libraries or
applications), that possibly have dependencies on other subdirectories.
There should be a flat hierarchy of directories under src/, which
contains individual modules.

As the name "src/" is already taken, that prevents any sensible
restructuring of the code.

As a first step, move "src/" to "src/core/". This gives space to
reorganize the code better by moving individual components into "src/".

For inspiration, look at systemd's "src/" directory.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
2021-02-04 09:45:55 +01:00

57 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
set -e
die() {
echo "$@"
exit 1
}
if [[ "x$(LANG=C git clean -ndx)" != x ]]; then
die "The working directory is not clean. Refuse to run. Try \`git clean -dx -n\`"
fi
if [[ "x$(git status --porcelain)" != x ]]; then
die "The working directory has local changes. Refuse to run. Try \`git reset --hard\`"
fi
build_out_of_tree() {
local TARGET="$1"
local C="$2"
local M="$3"
(
git clean -fdx || return 1
NOCONFIGURE=x ./autogen.sh || return 1
mkdir -p x/y || return 1
cd x/y || return 1
../../configure $C $NMTST_CONFIGURE || return 1
make $TARGET $M $NMTST_MAKE || return 1
)
}
TARGETS=("$@")
if [ "${#TARGETS}" -lt 1 ]; then
TARGETS=(
src/core/NetworkManager
src/core/nm-iface-helper
src/core/dhcp/nm-dhcp-helper
dispatcher/nm-dispatcher
clients/nm-online
clients/cli/nmcli
clients/tui/nmtui
src/core/platform/tests/monitor
src/core/ndisc/tests/test-ndisc-linux
$(git grep -h '\.l\?a\>' Makefile.am | sed 's/[a-zA-Z.0-9_-/]\+/\n\0\n/g' | sort -u | grep '\.l\?a$')
)
fi
set -x
cd "$(dirname "$(readlink -f "$0")")/.."
IDX=($(seq 0 $((${#TARGETS[@]} - 1))))
IDX=($(printf '%s\n' "${IDX[@]}" | sort -R))
for idx in "${IDX[@]}"; do
TARGET="${TARGETS[$idx]}"
echo "### $idx: TARGET=$TARGET"
build_out_of_tree "$TARGET" "--enable-gtk-doc" "-j 5"
done