Completes removal bash ARCHIVE loop; Adds basic Makefile for native windows build

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5338 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-11-11 18:36:28 +00:00
parent ec5601cbe3
commit 861bfe7d4a
17 changed files with 926 additions and 80 deletions
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+11 -2
View File
@@ -153,10 +153,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lod *.lst
+1 -29
View File
@@ -36,6 +36,7 @@
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
RGMPLIBDIR := $(RGMP_INST_DIR)/lib
RGMPINCDIR := $(RGMP_INST_DIR)/include
@@ -96,35 +97,6 @@ LDFLAGS += -nostdlib
EXTRA_LIBS = $(shell $(CC) -print-file-name=libsupc++.a) \
$(shell $(CC) -print-file-name=libgcc_eh.a)
define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef
define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef
define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.o *.a
endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh
HOSTCC = gcc
+1 -29
View File
@@ -36,6 +36,7 @@
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
RGMPLIBDIR := $(RGMP_INST_DIR)/lib
RGMPINCDIR := $(RGMP_INST_DIR)/include
@@ -94,35 +95,6 @@ LDFLAGS += -nostdlib
EXTRA_LIBS = $(shell $(CC) -print-file-name=libsupc++.a) \
$(shell $(CC) -print-file-name=libgcc_eh.a)
define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef
define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef
define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.o *.a
endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh
HOSTCC = gcc
+34
View File
@@ -1441,3 +1441,37 @@ Where <subdir> is one of the following:
The RTC alarm is used to wake up from STOP mode and to transition to
STANDBY mode. This used of the RTC alarm could conflict with other uses of
the RTC alarm in your application.
winbuild:
--------
This is a version of the apps/example/ostest, but configure to build natively
in the Windows CMD shell.
NOTES:
1. The beginnings of a Windows native build are in place but still not full
usable as of this writing. The windows native build logic is currently
separate and must be started by:
make -f Makefile.win
This build:
- Uses all Windows style paths
- Uses primarily Windows batch commands from cmd.exe, with
- A few extensions from GNUWin32 (or MSYS is you prefer)
In this build, you cannot use a Cygwin or MSYS shell. Rather the build must
be performed in a Windows CMD shell. Here is a better shell than than the
standard issue, CMD shell: ConEmu which can be downloaded from:
http://code.google.com/p/conemu-maximus5/
Build Tools. The build still relies on some Unix-like commands. I use
the GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/.
The MSYS tools are probably also a option but are likely lower performance
since they are based on Cygwin 1.3.
Host Compiler: I use the MingGW compiler which can be downloaded from
http://www.mingw.org/. If you are using GNUWin32, then it is recommended
the you not install the optional MSYS components as there may be conflicts.
+137
View File
@@ -0,0 +1,137 @@
############################################################################
# configs/stm32f4discovery/winbuild/Make.defs
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
# Setup for the selected toolchain
ifeq ($(CONFIG_STM32_CODESOURCERYW),y)
# CodeSourcery under Windows
CROSSDEV = arm-none-eabi-
ARCROSSDEV = arm-none-eabi-
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y)
# Atollic toolchain under Windows
CROSSDEV = arm-atollic-eabi-
ARCROSSDEV =
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
endif
ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y)
# Atollic toolchain under Windows
CROSSDEV = arm-atollic-eabi-
ARCROSSDEV = arm-atollic-eabi-
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
endif
ifeq ($(CONFIG_STM32_DEVKITARM),y)
# devkitARM under Windows
CROSSDEV = arm-eabi-
ARCROSSDEV = arm-eabi-
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ifeq ($(CONFIG_STM32_RAISONANCE),y)
# Raisonance RIDE7 under Windows
CROSSDEV = arm-none-eabi-
ARCROSSDEV = arm-none-eabi-
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
LDSCRIPT = ld.script
# Windows-native toolchains
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
CC = $(CROSSDEV)gcc.exe
CXX = $(CROSSDEV)g++.exe
CPP = $(CROSSDEV)gcc.exe -E
LD = $(CROSSDEV)ld.exe
AR = $(ARCROSSDEV)ar.exe rcs
NM = $(ARCROSSDEV)nm.exe
OBJCOPY = $(CROSSDEV)objcopy.exe
OBJDUMP = $(CROSSDEV)objdump.exe
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
ARCHOPTIMIZATION = -g
else
ARCHOPTIMIZATION = $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ARCHCFLAGS = -fno-builtin
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
LIBEXT = .a
EXEEXT = .exe
LDFLAGS += -nostartfiles -nodefaultlibs
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
HOSTCC = mingw-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
File diff suppressed because it is too large Load Diff
+48
View File
@@ -0,0 +1,48 @@
rem configs/stm32f4discovery/winbuild/setenv.sh
rem
rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
rem Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem 1. Redistributions of source code must retain the above copyright
rem notice, this list of conditions and the following disclaimer.
rem 2. Redistributions in binary form must reproduce the above copyright
rem notice, this list of conditions and the following disclaimer in
rem the documentation and/or other materials provided with the
rem distribution.
rem 3. Neither the name NuttX nor the names of its contributors may be
rem used to endorse or promote products derived from this software
rem without specific prior written permission.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
rem POSSIBILITY OF SUCH DAMAGE.
rem This is the location where I installed in the MinGW compiler. With
rem this configuration, it is recommended that you do NOT install the
rem MSYS tools; they conflict with the GNUWin32 tools. See
rem http://www.mingw.org/ for further info.
set PATH=C:\MinGW\bin;%PATH%
rem This is the location where I installed the CodeSourcey toolchain. See
rem http://www.mentor.com/embedded-software/codesourcery
set PATH=C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin;%PATH%
rem This is the location where I installed the GNUWin32 tools. See
rem http://gnuwin32.sourceforge.net/.
set PATH=C:\gnuwin32\bin;%PATH%
+11 -2
View File
@@ -146,10 +146,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lst
+11 -2
View File
@@ -146,10 +146,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lst
+11 -2
View File
@@ -172,10 +172,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lst
+11 -2
View File
@@ -172,10 +172,19 @@ define ASSEMBLE
@(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile)
endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
echo "AR: $2"; \
$(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; }
echo "AR: $2";
$(Q) for %%G in ($(subst ",,$(2))) do ( $(AR) $(ARFLAGS) $1=-+%%G )
endef
else
define ARCHIVE
$(Q) for __obj in $(2); do \
echo "AR: $(__obj)"; \
$(AR) $(ARFLAGS) $1=-+$(__obj) || { echo "$(AR) $1=-+$(__obj) FAILED!" ; exit 1 ; } \
done
endef
endif
define CLEAN
@rm -f *.obj *.src *.lib *.hex *.lst