Commit f3e9587b authored by Alessandro Rubini's avatar Alessandro Rubini

build: unify ppsi and ptp-noposix build scripts

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ff867c60
......@@ -7,20 +7,25 @@ if [ -z "$WRS_BASE_DIR" ]; then
fi
. ${WRS_BASE_DIR}/scripts/wrs_functions
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
# This step is controlled by Kconfig: skip it if not selected
if [ "x$CONFIG_PTP_NOPOSIX" = "x" ]; then
exit 0
if [ "x$CONFIG_PTP_NOPOSIX" != "x" ]; then
old_ptp=true; new_ptp=false
ptpname="ptp-noposix"
fi
if [ "x$CONFIG_PPSI" != "x" ]; then
old_ptp=false; new_ptp=true
ptpname="ppsi"
fi
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
wrs_echo "--- PTP daemon (noposix repository as a submodule)"
wrs_echo "--- PTP daemon ($ptpname repository as a submodule)"
# checkout, in case the user didn't do that
cd ${WRS_BASE_DIR}/..
git submodule init -q
git submodule update -q
cd userspace/ptp-noposix
cd userspace/$ptpname
make clean
# we need LINUX and CROSS_COMPILE. The latter is there for sure
......@@ -28,14 +33,18 @@ if [ "x$LINUX" == "x" ]; then
export LINUX="$WRS_OUTPUT_DIR/build/linux-2.6.39"
fi
make ptpd || wrs_die "cannot build ptp-noposix"
install -d "$WRS_OUTPUT_DIR/images/wr/bin"
install -d "$WRS_OUTPUT_DIR/images/wr/lib"
install -d "$WRS_OUTPUT_DIR/images/wr/include"
install ptpd "$WRS_OUTPUT_DIR/images/wr/bin"
install libptpnetif.a "$WRS_OUTPUT_DIR/images/wr/lib"
install libptpnetif/ptpd_netif.h "$WRS_OUTPUT_DIR/images/wr/include"
install libptpnetif/hal_client.h "$WRS_OUTPUT_DIR/images/wr/include"
#make $WRS_MAKE_J uImage modules || wrs_die "kernel compilation"
#cp arch/$ARCH/boot/uImage $(find . -name '*.ko') $WRS_OUTPUT_DIR/images
if [ $ptpname = ppsi ]; then
make ARCH=wrs PROTO_EXT=whiterabbit || wrs_die "Failure building PPSi"
install -d "$WRS_OUTPUT_DIR/images/wr/bin"
install ppsi "$WRS_OUTPUT_DIR/images/wr/bin"
else
make || wrs_die "Failure building $ptpname"
install -d "$WRS_OUTPUT_DIR/images/wr/bin"
install -d "$WRS_OUTPUT_DIR/images/wr/lib"
install -d "$WRS_OUTPUT_DIR/images/wr/include"
install ptpd "$WRS_OUTPUT_DIR/images/wr/bin"
install libptpnetif.a "$WRS_OUTPUT_DIR/images/wr/lib"
install libptpnetif/ptpd_netif.h "$WRS_OUTPUT_DIR/images/wr/include"
install libptpnetif/hal_client.h "$WRS_OUTPUT_DIR/images/wr/include"
fi
......@@ -155,8 +155,7 @@ wrs_build_step 02-at91boot wrs_build_at91boot
wrs_build_step 03-barebox wrs_build_barebox
wrs_build_step 04-kernel wrs_build_kernel
wrs_build_step 05-modules wrs_build_modules
wrs_build_step 06-ptp-noposix wrs_build_ptp_noposix
wrs_build_step 06-ppsi wrs_build_ppsi
wrs_build_step 06-ptp wrs_build_ptp
wrs_build_step 07-wrs-userspace wrs_build_userspace
wrs_build_step 08-wrs-gateware wrs_build_gateware
wrs_build_step 09-wrap-rootfs wrs_build_wraprootfs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment