From 8e9914893d8e68aa96baecafbe34f7dba7828419 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 5 Sep 2014 11:26:42 -0600 Subject: [PATCH] The apps/ import build requires that we extract more information from the platform Make.defs file. --- tools/Makefile.export | 31 ++++++++++++++++++++++++++++--- tools/mkexport.sh | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/tools/Makefile.export b/tools/Makefile.export index 6dfe72bf99..071dbaa1b2 100644 --- a/tools/Makefile.export +++ b/tools/Makefile.export @@ -1,7 +1,7 @@ ############################################################################ # Makefile.export # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -37,10 +37,10 @@ include $(TOPDIR)/.config include $(EXPORTDIR)/Make.defs ifdef ARCHSCRIPT -# + # ARCHSCRIPT may contain a leading -T; it must not be followed by a space # for this to work. -# + ifeq ($(WINTOOL),y) LDPATH = $(shell cygpath -u $(patsubst -T%,%,$(ARCHSCRIPT))) else @@ -70,7 +70,32 @@ ifdef ARCHSCRIPT endif @echo "ARCHCFLAGS=\"$(ARCHCFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh @echo "ARCHCXXFLAGS=\"$(ARCHCXXFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "ARCHPICFLAGS=\"$(ARCHPICFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "ARCHWARNINGS=\"$(ARCHWARNINGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "ARCHWARNINGSXX=\"$(ARCHWARNINGSXX)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "ARCHOPTIMIZATION=\"$(ARCHOPTIMIZATION)\"" >> $(EXPORTDIR)/makeinfo.sh @echo "CROSSDEV=\"$(CROSSDEV)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "CC=\"$(CC)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "CXX=\"$(CXX)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "CPP=\"$(CPP)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "LD=\"$(LD)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "AR=\"$(AR)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "NM=\"$(NM)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "OBJCOPY=\"$(OBJCOPY)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "OBJDUMP=\"$(OBJDUMP)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "NXFLATLDFLAGS1=\"$(NXFLATLDFLAGS1)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "NXFLATLDFLAGS2=\"$(NXFLATLDFLAGS2)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "OBJEXT=\"$(OBJEXT)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "LIBEXT=\"$(LIBEXT)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "EXEEXT=\"$(EXEEXT)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "HOSTCC=\"$(HOSTCC)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "HOSTINCLUDES=\"$(HOSTINCLUDES)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "HOSTCFLAGS=\"$(HOSTCFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "HOSTLDFLAGS=\"$(HOSTLDFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "HOSTEXEEXT=\"$(HOSTEXEEXT)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "DIRLINK=\"$(DIRLINK)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "DIRUNLINK=\"$(DIRUNLINK)\"" >> $(EXPORTDIR)/makeinfo.sh + @echo "MKDEP=\"$(MKDEP)\"" >> $(EXPORTDIR)/makeinfo.sh $(Q) chmod 755 $(EXPORTDIR)/makeinfo.sh clean: diff --git a/tools/mkexport.sh b/tools/mkexport.sh index 18087d480c..9b76afbc6b 100755 --- a/tools/mkexport.sh +++ b/tools/mkexport.sh @@ -195,8 +195,38 @@ fi # Save the compilation options -echo "ARCHCFLAGS = ${ARCHCFLAGS}" >"${EXPORTDIR}/build/Make.defs" -echo "ARCHCXXFLAGS = ${ARCHCXXFLAGS}" >>"${EXPORTDIR}/build/Make.defs" +if [ "X${USRONLY}" == "Xy" ]; then + echo "ARCHCFLAGS = ${ARCHCFLAGS}" >"${EXPORTDIR}/build/Make.defs" + echo "ARCHCXXFLAGS = ${ARCHCXXFLAGS}" >>"${EXPORTDIR}/build/Make.defs" + echo "ARCHPICFLAGS = ${ARCHPICFLAGS}" >>"${EXPORTDIR}/build/Make.defs" + echo "ARCHWARNINGS = ${ARCHWARNINGS}" >>"${EXPORTDIR}/build/Make.defs" + echo "ARCHWARNINGSXX = ${ARCHWARNINGSXX}" >>"${EXPORTDIR}/build/Make.defs" + echo "ARCHOPTIMIZATION = ${ARCHOPTIMIZATION}" >>"${EXPORTDIR}/build/Make.defs" + echo "CROSSDEV = ${CROSSDEV}" >>"${EXPORTDIR}/build/Make.defs" + echo "CC = ${CC}" >>"${EXPORTDIR}/build/Make.defs" + echo "CXX = ${CXX}" >>"${EXPORTDIR}/build/Make.defs" + echo "CPP = ${CPP}" >>"${EXPORTDIR}/build/Make.defs" + echo "LD = ${LD}" >>"${EXPORTDIR}/build/Make.defs" + echo "AR = ${AR}" >>"${EXPORTDIR}/build/Make.defs" + echo "NM = ${NM}" >>"${EXPORTDIR}/build/Make.defs" + echo "OBJCOPY = ${OBJCOPY}" >>"${EXPORTDIR}/build/Make.defs" + echo "OBJDUMP = ${OBJDUMP}" >>"${EXPORTDIR}/build/Make.defs" + echo "NXFLATLDFLAGS1 = ${NXFLATLDFLAGS1}" >>"${EXPORTDIR}/build/Make.defs" + echo "NXFLATLDFLAGS2 = ${NXFLATLDFLAGS2}" >>"${EXPORTDIR}/build/Make.defs" + echo "OBJEXT = ${OBJEXT}" >>"${EXPORTDIR}/build/Make.defs" + echo "LIBEXT = ${LIBEXT}" >>"${EXPORTDIR}/build/Make.defs" + echo "EXEEXT = ${EXEEXT}" >>"${EXPORTDIR}/build/Make.defs" + echo "HOSTCC = ${HOSTCC}" >>"${EXPORTDIR}/build/Make.defs" + echo "HOSTCFLAGS = ${HOSTCFLAGS}" >>"${EXPORTDIR}/build/Make.defs" + echo "HOSTLDFLAGS = ${HOSTLDFLAGS}" >>"${EXPORTDIR}/build/Make.defs" + echo "HOSTEXEEXT = ${HOSTEXEEXT}" >>"${EXPORTDIR}/build/Make.defs" + echo "DIRLINK = ${DIRLINK}" >>"${EXPORTDIR}/build/Make.defs" + echo "DIRUNLINK = ${DIRUNLINK}" >>"${EXPORTDIR}/build/Make.defs" + echo "MKDEP = ${MKDEP}" >>"${EXPORTDIR}/build/Make.defs" +else + echo "ARCHCFLAGS = ${ARCHCFLAGS}" >"${EXPORTDIR}/build/Make.defs" + echo "ARCHCXXFLAGS = ${ARCHCXXFLAGS}" >>"${EXPORTDIR}/build/Make.defs" +fi # Copy the NuttX include directory (retaining attributes and following symbolic links)