Skip to content

Commit e5363e9

Browse files
committed
scripts: add autogen.sh and rebuild.sh for full autotools regeneration
- Added logic to remove stale autotools artifacts - Improved logging and regeneration steps for developer convenience Signed-off-by: Srikanth Muppandam <[email protected]>
1 parent b0c16c0 commit e5363e9

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

autogen.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
# Copyright (c) Qualcomm Technologies, Inc.
4+
5+
set -e
6+
7+
PROJECT_ROOT=$(dirname "$0")
8+
9+
echo "Starting autotools cleanup and regeneration..."
10+
11+
clean_autotools_files() {
12+
echo " - Cleaning autotools-generated files..."
13+
14+
FILE_PATTERNS="Makefile.in Makefile config.* stamp-h1 configure configure~ aclocal.m4 compile install-sh ltmain.sh missing"
15+
for pattern in $FILE_PATTERNS; do
16+
find "$PROJECT_ROOT" -name "$pattern" -exec rm -f {} +
17+
done
18+
19+
# Remove directories
20+
find "$PROJECT_ROOT" -name 'autom4te.cache' -type d -exec rm -rf {} +
21+
find "$PROJECT_ROOT" -name '.deps' -type d -exec rm -rf {} +
22+
}
23+
24+
regenerate_build_system() {
25+
echo " - Regenerating with autoreconf..."
26+
autoreconf --install --force --verbose
27+
}
28+
29+
main() {
30+
clean_autotools_files
31+
regenerate_build_system
32+
echo
33+
echo "Autotools setup complete."
34+
echo "You can now run:"
35+
echo " ./configure"
36+
echo " make"
37+
}
38+
39+
main "$@"

rebuild.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
# Copyright (c) Qualcomm Technologies, Inc.
4+
5+
set -e
6+
7+
echo "Running full clean and rebuild..."
8+
9+
# Step 1: Clean previous build artifacts
10+
if [ -f Makefile ]; then
11+
echo " - Running make distclean..."
12+
make distclean || true
13+
fi
14+
15+
# Step 2: Run autogen to regenerate build system files
16+
echo " - Running autogen.sh..."
17+
./autogen.sh
18+
19+
# Step 3: Run configure
20+
echo " - Running ./configure..."
21+
./configure
22+
23+
# Step 4: Build
24+
echo " - Running make..."
25+
make
26+
27+
echo "Rebuild complete."

0 commit comments

Comments
 (0)