Fixes for compile

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@555 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-01-12 17:37:22 +00:00
parent fbf8e11f77
commit 7303584054
3 changed files with 35 additions and 7 deletions

View File

@ -36,14 +36,21 @@
-include $(TOPDIR)/Make.defs
-include chip/Make.defs
COMPILER = ${shell basename $(CC)}
ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
ifeq ($(COMPILER),zneocc.exe)
WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)}
USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common'
else
WARCHSRCDIR = $(ARCHSRCDIR)
USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common
endif
INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES)
CPPFLAGS += -I$(ARCHSRCDIR)
WLINKLIBS =
ifeq ($(COMPILER),zneocc.exe)
LDFLAGS = @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}"
endif
HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT))
HEAD_AOBJ = $(HEAD_SSRC:.S=$(OBJEXT))
@ -64,6 +71,7 @@ VPATH = chip:common
all: $(HEAD_OBJ) libarch$(LIBEXT)
ifeq ($(COMPILER),zneocc.exe)
$(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S
@$(CPP) $(CPPFLAGS) $< -o $@.tmp
@cat $@.tmp | sed -e "s/^#/;/g" > $@
@ -71,9 +79,17 @@ $(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S
$(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %$(ASMEXT)
$(call ASSEMBLE, $<, $@)
else
$(OBJS) $(HEAD_AOBJ): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)endif
endif
$(COBJS): %$(OBJEXT): %.c
ifeq ($(COMPILER),zneocc.exe)
$(call COMPILE, `cygpath -w $<`, $@)
else
$(call COMPILE, $<, $@)
endif
libarch$(LIBEXT): $(OBJS)
@( for obj in $(OBJS) ; do \
@ -83,6 +99,7 @@ libarch$(LIBEXT): $(OBJS)
board/libboard$(LIBEXT):
@$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT)
ifeq ($(COMPILER),zneocc.exe)
nuttx.linkcmd: $(LINKCMDTEMPLATE)
@cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd
@echo "\"${shell cygpath -w $(TOPDIR)/nuttx}\"= \\" >>nuttx.linkcmd
@ -91,6 +108,9 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE)
echo " `cygpath -w $(TOPDIR)/$${lib}`, \\" >>nuttx.linkcmd; \
done ; )
@echo " ${shell cygpath -w $(ARCHSRCDIR)/board/libboard$(LIBEXT)}" >>nuttx.linkcmd
else
nuttx.linkcmd:
endif
nuttx$(EXEEXT): $(HEAD_AOBJ) board/libboard$(LIBEXT) nuttx.linkcmd
@echo "LD: nuttx.hex"
@ -109,7 +129,10 @@ clean:
@if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi
@rm -f libarch$(LIBEXT) nuttx.linkcmd *~ .*.swp *.asm *.tmp *.map
@rm -f libarch$(LIBEXT) *~ .*.swp
ifeq ($(COMPILER),zneocc.exe)
@rm -f nuttx.linkcmd *.asm *.tmp *.map
endif
$(call CLEAN)
distclean: clean

View File

@ -395,10 +395,10 @@
/* Bits 5-6: Timer configuration,
* Interpretation depends on timer mode */
#define Z16F_TIMERCTL0_RELOAD _HX8(00) /* Interrupt occurs on reload or capture */
#define Z16F_TIMERCTL0_DISABLED _HX8(40) /* Disabled */
#define Z16F_TIMERCTL0_INACTIVE _HX8(40) /* Interrrupt occurs on inactive gate edge */
#define Z16F_TIMERCTL0_CAPTURE _HX8(40) /* Interrupt occurs on capture */
#define Z16F_TIMERCTL0_RELOAD _HX8(60) /* Interrupt occurs on reload */
#define Z16F_TIMERCTL0_IDISABLED _HX8(40) /* Disabled */
#define Z16F_TIMERCTL0_IINACTIVE _HX8(40) /* Interrrupt occurs on inactive gate edge */
#define Z16F_TIMERCTL0_ICAPTURE _HX8(40) /* Interrupt occurs on capture */
#define Z16F_TIMERCTL0_IRELOAD _HX8(60) /* Interrupt occurs on reload */
#define Z16F_TIMERCTL0_CASCADE _HX8(10) /* Bit 4: Timer is cascaded */
/* Bits 1-2: PW mode */
#define Z16F_TIMERCTL0_NODELAY _HZ8(00) /* No delay */

View File

@ -39,6 +39,9 @@
* Included Files
***************************************************************************/
#include <sys/types.h>
#include "chip/chip.h"
/***************************************************************************
* Definitions
***************************************************************************/
@ -55,14 +58,16 @@ extern _Erom unsigned long SYS_CLK_FREQ;
/* Setup FLASH options at address 0x00000000 */
#if 0 /* Setup in z16f_head.S */
Z16F_FLOPTION0 = (Z16F_FLOPTION0_MAXPWR|Z16F_FLOPTION0_WDTRES|\
Z16F_FLOPTION0_WDTA0|Z16F_FLOPTION0_VBOA0|\
Z16F_FLOPTION0_DBGUART|Z16F_FLOPTION0_FWP|
Z16F_FLOPTION0_DBGUART|Z16F_FLOPTION0_FWP|\
Z16F_FLOPTION0_RP);
Z16F_FLOPTION1 = (Z16F_FLOPTION1_RESVD|Z16F_FLOPTION1_MCEN|\
Z16F_FLOPTION1_OFFH|Z16F_FLOPTION1_OFFL);
Z16F_FLOPTION2 = Z16F_FLOPTION2_RESVD;
Z16F_FLOPTION3 = (Z16F_FLOPTION3_RESVD|Z16F_FLOPTION3_NORMAL);
#endif
/***************************************************************************
* Private Functions