tools/Makefile.* and tools/mkexport.sh: This change allows to export builtin applications registry into temporarily created directory where export archive content is prepared. If the Makefile in apps directory does not define export: target then error is print but export continues without interruption. It would be more logical to print warning but there is no way instruct apps make to not print error.

This commit is contained in:
Pavel Pisa 2019-08-30 07:19:15 -06:00 committed by Gregory Nutt
parent b33fc302f0
commit f1b2155efc
3 changed files with 31 additions and 2 deletions

View File

@ -179,6 +179,13 @@ else ifeq ($(CONFIG_BUILD_LOADABLE),y)
MKEXPORT_ARGS += -u MKEXPORT_ARGS += -u
endif endif
ifneq ($(APPDIR),)
ifneq ($(shell [ -e $(APPDIR)/Makefile ] && echo yes),)
MKEXPORT_ARGS += -a "$(APPDIR)"
MKEXPORT_ARGS += -m "$(MAKE)"
endif
endif
ifeq ($(V),2) ifeq ($(V),2)
MKEXPORT_ARGS += -d MKEXPORT_ARGS += -d
endif endif

View File

@ -167,6 +167,13 @@ else ifeq ($(CONFIG_BUILD_LOADABLE),y)
MKEXPORT_ARGS += -u MKEXPORT_ARGS += -u
endif endif
ifneq ($(APPDIR),)
ifneq ($(shell [ -e $(APPDIR)/Makefile ] && echo yes),)
MKEXPORT_ARGS += -a "$(APPDIR)"
MKEXPORT_ARGS += -m "$(MAKE)"
endif
endif
ifeq ($(V),2) ifeq ($(V),2)
MKEXPORT_ARGS += -d MKEXPORT_ARGS += -d
endif endif

View File

@ -34,16 +34,22 @@
# Get the input parameter list # Get the input parameter list
USAGE="USAGE: $0 [-d] [-z] [-u] [-w|wy|wn] -t <top-dir> [-x <lib-ext>] -l \"lib1 [lib2 [lib3 ...]]\"" USAGE="USAGE: $0 [-d] [-z] [-u] [-w|wy|wn] -t <top-dir> [-x <lib-ext>] [-a <apps-dir>] [-m <make-exe>] -l \"lib1 [lib2 [lib3 ...]]\""
unset TOPDIR unset TOPDIR
unset LIBLIST unset LIBLIST
unset TGZ unset TGZ
unset APPDIR
USRONLY=n USRONLY=n
WINTOOL=n WINTOOL=n
LIBEXT=.a LIBEXT=.a
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-a )
shift
APPDIR="$1"
;;
-d ) -d )
set -x set -x
;; ;;
@ -51,6 +57,10 @@ while [ ! -z "$1" ]; do
shift shift
LIBLIST=$1 LIBLIST=$1
;; ;;
-m )
shift
MAKE="$1"
;;
-wy ) -wy )
WINTOOL=y WINTOOL=y
;; ;;
@ -240,7 +250,7 @@ echo "MKDEP = ${MKDEP}" >>"${EXPORTDIR}/build/Make.defs"
# Additional compilation options when the kernel is built # Additional compilation options when the kernel is built
if [ "X${USRONLY}" != "Xy" ] then if [ "X${USRONLY}" != "Xy" ]; then
echo "LDFLAGS = ${LDFLAGS}" >>"${EXPORTDIR}/build/Make.defs" echo "LDFLAGS = ${LDFLAGS}" >>"${EXPORTDIR}/build/Make.defs"
echo "HEAD_OBJ = ${HEAD_OBJ}" >>"${EXPORTDIR}/build/Make.defs" echo "HEAD_OBJ = ${HEAD_OBJ}" >>"${EXPORTDIR}/build/Make.defs"
echo "EXTRA_OBJS = ${EXTRA_OBJS}" >>"${EXPORTDIR}/build/Make.defs" echo "EXTRA_OBJS = ${EXTRA_OBJS}" >>"${EXPORTDIR}/build/Make.defs"
@ -399,6 +409,11 @@ done
cd "${TOPDIR}" || \ cd "${TOPDIR}" || \
{ echo "MK: 'cd ${TOPDIR}' failed"; exit 1; } { echo "MK: 'cd ${TOPDIR}' failed"; exit 1; }
if [ -e "${APPDIR}/Makefile" ]; then
"${MAKE}" -C "${TOPDIR}/${APPDIR}" EXPORTDIR="$(cd "${EXPORTSUBDIR}" ; pwd )" TOPDIR="${TOPDIR}" export || \
{ echo "MK: call make export for APPDIR not supported"; }
fi
if [ "X${TGZ}" = "Xy" ]; then if [ "X${TGZ}" = "Xy" ]; then
tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1 tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
gzip -f "${EXPORTSUBDIR}.tar" gzip -f "${EXPORTSUBDIR}.tar"