ZNEO now (almost) builds in Windows native environment

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5402 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-11-29 22:27:22 +00:00
parent c9230359ef
commit f63b1d9296
21 changed files with 62 additions and 23 deletions

View File

@ -33,10 +33,15 @@
# #
############################################################################ ############################################################################
PCODEDIR := ${shell pwd | sed -e 's/ /\\ /g'}
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
include $(APPDIR)$(DELIM)Make.defs include $(APPDIR)$(DELIM)Make.defs
DELIM ?= $(strip /)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
PCODEDIR := ${shell echo %CD%}
else
PCODEDIR := ${shell pwd | sed -e 's/ /\\ /g'}
endif
# Default tools # Default tools

View File

@ -3712,7 +3712,10 @@
From Freddie Chopin. From Freddie Chopin.
* z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to * z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to
support the Windows native builds (see corresponding README.txt files). support the Windows native builds (see corresponding README.txt files).
* configures/z16f2800100zcog - All configurations updated to use the ZDS-II * configs/z16f2800100zcog - All configurations updated to use the ZDS-II
5.0.1 toolchain. 5.0.1 toolchain.
* configures/z16f2800100zcog - All configurations updated to use Kconfig/mconf * configs/z16f2800100zcog - All configurations updated to use Kconfig/mconf
configuration tools. configuration tools.
* configs/z16f2800100zcog/ostest - Now supports a native Windows build
(other ZNEO configs may also support the native build, but this has not
been verfiied).

View File

@ -56,10 +56,10 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHD
CPPFLAGS += -I$(ARCHSRCDIR) CPPFLAGS += -I$(ARCHSRCDIR)
ifeq ($(CONFIG_WINDOWS_NATIVE),y) ifeq ($(CONFIG_WINDOWS_NATIVE),y)
LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd" LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd"
else else
ifeq ($(COMPILER),zneocc.exe) ifeq ($(COMPILER),zneocc.exe)
LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}" LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}"
endif endif
endif endif
@ -108,7 +108,7 @@ ifeq ($(COMPILER),zneocc.exe)
nuttx.linkcmd: $(LINKCMDTEMPLATE) nuttx.linkcmd: $(LINKCMDTEMPLATE)
$(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd
ifeq ($(CONFIG_WINDOWS_NATIVE),y) ifeq ($(CONFIG_WINDOWS_NATIVE),y)
@echo "$(TOPDIR)\nuttx}"= \>>nuttx.linkcmd @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd
@echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd
$(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd )
@echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd
@ -133,30 +133,42 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.linkcmd
$(Q) $(LD) $(LDFLAGS) $(Q) $(LD) $(LDFLAGS)
.depend: Makefile chip/Make.defs $(DEPSRCS) .depend: Makefile chip/Make.defs $(DEPSRCS)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend )
else
$(Q) if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi fi
endif
$(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep
$(Q) touch $@ $(Q) touch $@
# This is part of the top-level export target # This is part of the top-level export target
export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y)
else
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
else \ else \
echo "$(EXPORT_DIR)/startup does not exist"; \ echo "$(EXPORT_DIR)/startup does not exist"; \
exit 1; \ exit 1; \
fi fi
endif
# Dependencies # Dependencies
depend: .depend depend: .depend
clean: clean:
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean )
else
$(Q) if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi fi
endif
ifeq ($(COMPILER),zneocc.exe) ifeq ($(COMPILER),zneocc.exe)
$(call DELFILE, nuttx.linkcmd) $(call DELFILE, nuttx.linkcmd)
$(call DELFILE, *.asm) $(call DELFILE, *.asm)
@ -167,9 +179,13 @@ endif
$(call CLEAN) $(call CLEAN)
distclean: clean distclean: clean
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean )
else
$(Q) if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \
fi fi
endif
$(call DELFILE, Make.dep) $(call DELFILE, Make.dep)
$(call DELFILE, .depend) $(call DELFILE, .depend)

View File

@ -34,6 +34,7 @@
############################################################################ ############################################################################
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
INCDIROPT = -w INCDIROPT = -w

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -181,7 +181,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -139,6 +139,9 @@ ostest
the end of the lines after a line continuation (\ ^M). If these the end of the lines after a line continuation (\ ^M). If these
trailing bad characters are manually eliminated, then the build trailing bad characters are manually eliminated, then the build
will succeed on the next try. will succeed on the next try.
d. Hmmm... when last tested, there some missing .obj files in arch/z16/src.
A little additional TLC might be needed to get a reliable Windows
native build.
pashello pashello
-------- --------

View File

@ -174,7 +174,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -8,10 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y
# Build Setup # Build Setup
# #
# CONFIG_EXPERIMENTAL is not set # CONFIG_EXPERIMENTAL is not set
CONFIG_HOST_LINUX=y # CONFIG_HOST_LINUX is not set
# CONFIG_HOST_OSX is not set # CONFIG_HOST_OSX is not set
# CONFIG_HOST_WINDOWS is not set CONFIG_HOST_WINDOWS=y
# CONFIG_HOST_OTHER is not set # CONFIG_HOST_OTHER is not set
# CONFIG_WINDOWS_NATIVE is not set
CONFIG_WINDOWS_CYGWIN=y
# CONFIG_WINDOWS_MSYS is not set
# CONFIG_WINDOWS_OTHER is not set
# #
# Build Configuration # Build Configuration

View File

@ -174,7 +174,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -8,10 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y
# Build Setup # Build Setup
# #
# CONFIG_EXPERIMENTAL is not set # CONFIG_EXPERIMENTAL is not set
CONFIG_HOST_LINUX=y # CONFIG_HOST_LINUX is not set
# CONFIG_HOST_OSX is not set # CONFIG_HOST_OSX is not set
# CONFIG_HOST_WINDOWS is not set CONFIG_HOST_WINDOWS=y
# CONFIG_HOST_OTHER is not set # CONFIG_HOST_OTHER is not set
# CONFIG_WINDOWS_NATIVE is not set
CONFIG_WINDOWS_CYGWIN=y
# CONFIG_WINDOWS_MSYS is not set
# CONFIG_WINDOWS_OTHER is not set
# #
# Build Configuration # Build Configuration

View File

@ -39,7 +39,7 @@ SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched
ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src
ifeq ($(CONFIG_WINDOWS_NATIVE),y) ifeq ($(CONFIG_WINDOWS_NATIVE),y)
USRINCLUDES = -usrinc:'.;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common' USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common"
else else
WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)}
WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)}

View File

@ -207,7 +207,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -207,7 +207,7 @@ define ASSEMBLE
endef endef
define ARCHIVE define ARCHIVE
echo AR: $2 @echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef endef

View File

@ -34,6 +34,7 @@
############################################################################ ############################################################################
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
INCDIROPT = -w INCDIROPT = -w

View File

@ -34,6 +34,8 @@
########################################################################### ###########################################################################
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
include proxies$(DELIM)Make.defs include proxies$(DELIM)Make.defs
include stubs$(DELIM)Make.defs include stubs$(DELIM)Make.defs