Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
8e1aa33c
Commit
8e1aa33c
authored
Dec 22, 2020
by
吴洲洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add build vpp script
parent
4ab49901
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
156 additions
and
0 deletions
+156
-0
scripts/build_vpp
scripts/build_vpp
+156
-0
No files found.
scripts/build_vpp
0 → 100755
View file @
8e1aa33c
#!/bin/bash
################################################################################
################################################################################
# file build_upf
# brief
# author bupt
# company bupt
# email:
#
set
-o
pipefail
INSTALL_DIR
=
/usr/local/bin
################################
# include helper functions
################################
THIS_SCRIPT_PATH
=
$(
dirname
$(
readlink
-f
$0
))
PWD
=
$(
pwd
)
BUILD_ROOT
=
"build-root"
BUILD_DEBUG
=
0
BUILD_RELEASE
=
0
BUILD_DEBUG_PKG
=
0
BUILD_RELEASE_PKG
=
0
clear_all
()
{
make wipe
;
make wipe-relase
;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/build-test
;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/build-vpp_debug-native
;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/build-vpp-native
;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/install-vpp-native
;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/install-vpp_debug-native
;
}
build_debug
()
{
echo
"make debug"
clear_all
make rebuild
}
build_release
()
{
echo
"make release"
clear_all
make rebuild-release
}
make_package
()
{
#clear
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/.ccache
;
find
$PWD
/
${
BUILD_ROOT
}
/
-name
'*.c'
-type
f
-print
-exec
rm
-rf
{}
\;
find
$PWD
/
${
BUILD_ROOT
}
/
-name
'*.o'
-type
f
-print
-exec
rm
-rf
{}
\;
find
$PWD
/
${
BUILD_ROOT
}
/
-name
'*.o.cmd'
-type
f
-print
-exec
rm
-rf
{}
\;
find
$PWD
/
${
BUILD_ROOT
}
/
-name
'*.debug'
-type
f
-print
-exec
rm
-rf
{}
\;
find
$PWD
/
${
BUILD_ROOT
}
/
-name
'*.api.json'
-type
f
-print
-exec
rm
-rf
{}
\;
rm
-rf
$PWD
/
${
BUILD_ROOT
}
/build-test
;
#rm -rf $PWD/${BUILD_ROOT}/build-vpp_debug-native;
#rm -rf $PWD/${BUILD_ROOT}/build-vpp-native;
#pkg
tmp_time
=
$(
date
"+%Y-%m-%d-%H-%M-%S"
)
vpp_time_tar_gz
=
"buptvppe-
$1
-
${
tmp_time
}
.tar.gz"
sudo tar
-zcvf
$vpp_time_tar_gz
${
BUILD_ROOT
}
sudo mv
$vpp_time_tar_gz
../
}
build_debug_pkg
()
{
echo
"make debug pkg"
clear_all
make pkg-deb-debug
make_package debug
}
build_release_pkg
()
{
echo
"make release pkg"
clear_all
make pkg-deb
make_package release
}
build
()
{
if
[
$BUILD_DEBUG
==
1
]
;
then
build_debug
exit
1
;
fi
if
[
$BUILD_RELEASE
==
1
]
;
then
build_release
exit
1
;
fi
if
[
$BUILD_DEBUG_PKG
==
1
]
;
then
build_debug_pkg
exit
1
;
fi
if
[
$BUILD_RELEASE_PKG
==
1
]
;
then
build_release_pkg
exit
1
;
fi
return
0
}
function
help
()
{
echo
" "
echo
"Usage: build_vpp [OPTION]..."
echo
"-d | --debug Build vpp debug version."
echo
"-r | --release Build vpp release version."
echo
"-dp | --debug pkg Build vpp debug pakcage version."
echo
"-rp | --release pkg BUILD vpp relase package version."
echo
" "
}
function
main
()
{
if
[
$#
-eq
0
]
;
then
help
exit
fi
until
[
-z
"
$1
"
]
do
case
"
$1
"
in
-d
|
--debug
)
BUILD_DEBUG
=
1
shift
;
;;
-r
|
--release
)
BUILD_RELEASE
=
1
shift
;
;;
-dp
|
--debug-pkg
)
BUILD_DEBUG_PKG
=
1
shift
;
;;
-rp
|
--release-pkg
)
BUILD_RELEASE_PKG
=
1
shift
;
;;
*
)
echo
"Unknown option
$1
"
help
return
1
;;
esac
done
##############################################################################
# build
##############################################################################
build
return
0
}
main
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment