如6楼所说的在Tornado的标准BSP下是可以编译的(只是一个没有具体内容的vxWorks.st),但在我自己建的Project下则不行。
以下是我的Makefile文件,请高手指教。
## core information
ifeq ($(wildcard Makefile),)
PRJ_DIR = ..
else
PRJ_DIR = .
endif
PRJ_FILE = VMWareLC32.wpj
PRJ_TYPE = vxWorks
PRJ_OBJS = sysALib.o sysLib.o usrAppInit.o prjConfig.o linkSyms.o
BOOT_OBJS = romInit.o romStart.o $(BOOT_EXTRA)
BUILD_SPEC = default
BSP_DIR = $(WIND_BASE)/target/config/pcPentium
TGT_DIR = $(WIND_BASE)/target
## set searching directories for dependencies
vpath %.c $(BSP_DIR)
vpath %.cpp $(BSP_DIR)
vpath %.cxx $(BSP_DIR)
## build-configuration info
ifeq ($(BUILD_SPEC),default)
CPU = PENTIUM
TOOL = gnu
TOOL_FAMILY = gnu
DEFAULT_RULE = vxWorks
endif
## component-configuration info
COMPONENTS = INCLUDE_ANSI_ASSERT \
INCLUDE_ANSI_CTYPE \
INCLUDE_ANSI_LOCALE \
INCLUDE_ANSI_MATH \
INCLUDE_ANSI_STDIO \
INCLUDE_ANSI_STDIO_EXTRA \
INCLUDE_ANSI_STDLIB \
INCLUDE_ANSI_STRING \
INCLUDE_ANSI_TIME \
INCLUDE_ARP_API \
.............
INCLUDE_WINDVIEW \
INCLUDE_WINDVIEW_CLASS \
INCLUDE_WVUPLOAD_FILE \
INCLUDE_WVUPLOAD_TSFSSOCK
COMPONENT_LIBS =
include $(TGT_DIR)/h/make/defs.project
## build-configuration info
ifeq ($(BUILD_SPEC),default)
AR = arpentium
AS = ccpentium
BOOT_EXTRA =
CC = ccpentium
CC_ARCH_SPEC = -mcpu=pentium -march=pentium
CFLAGS = -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD
CFLAGS_AS = -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -P -xassembler-with-cpp -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD
CFLAGS_AS_PROJECT = -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I/h -I. -I$(WIND_BASE)\target\config\all -I$(WIND_BASE)\target/h -I$(WIND_BASE)\target/src/config -I$(WIND_BASE)\target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -P -xassembler-with-cpp
CFLAGS_PROJECT = -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I/h -I. -I$(WIND_BASE)\target\config\all -I$(WIND_BASE)\target/h -I$(WIND_BASE)\target/src/config -I$(WIND_BASE)\target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu
CPP = ccpentium -E -P
EXTRA_MODULES =
LD = ldpentium
LDFLAGS = -X -N
LD_LINK_PATH = -L$(WIND_BASE)/target/lib/pentium/PENTIUM/gnu -L$(WIND_BASE)/target/lib/pentium/PENTIUM/common
LD_PARTIAL = ccpentium -r -nostdlib -Wl,-X
LD_PARTIAL_FLAGS = -X -r
LIBS = $(VX_OS_LIBS)
NM = nmpentium -g
OPTION_DEFINE_MACRO = -D
OPTION_DEPEND = -M -w
OPTION_GENERATE_DEPENDENCY_FILE = -MD
OPTION_INCLUDE_DIR = -I
OPTION_LANG_C = -xc
OPTION_UNDEFINE_MACRO = -U
RAM_HIGH_ADRS = 00108000 # Boot image entry point
RAM_LOW_ADRS = 00308000 # VxWorks image entry point
SIZE = sizepentium
TOOL_FAMILY = gnu
POST_BUILD_RULE =
endif
# override make definitions only below this line
# override make definitions only above this line
include $(TGT_DIR)/h/make/rules.project
## build-configuration info
sysALib.o: $(PRJ_DIR)/prjParams.h
ifeq ($(BUILD_SPEC),default)
usrAppInit.o:
$(CC) -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD -c $(PRJ_DIR)/usrAppInit.c
endif
ifeq ($(BUILD_SPEC),default_rom)
usrAppInit.o:
$(CC) -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD -c $(PRJ_DIR)/usrAppInit.c
endif
ifeq ($(BUILD_SPEC),default_romCompress)
usrAppInit.o:
$(CC) -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD -c $(PRJ_DIR)/usrAppInit.c
endif
ifeq ($(BUILD_SPEC),default_romResident)
usrAppInit.o:
$(CC) -g -mcpu=pentium -march=pentium -ansi -nostdlib -fno-builtin -fno-defer-pop -I$(PRJ_DIR) -I$(WIND_BASE)/target/config/pcPentium -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/config/comps/src -I$(WIND_BASE)/target/src/drv -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD -c $(PRJ_DIR)/usrAppInit.c
endif
## dependencies
sysALib.o: $(WIND_BASE)/target/config/pcPentium/sysALib.s \
$(PRJ_DIR)/prjComps.h \
$(PRJ_DIR)/prjParams.h
sysLib.o: $(WIND_BASE)/target/config/pcPentium/sysLib.c \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stddef.h \
$(PRJ_DIR)/prjComps.h \
$(PRJ_DIR)/prjParams.h \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stdarg.h
romInit.o: $(WIND_BASE)/target/config/pcPentium/romInit.s \
$(PRJ_DIR)/prjComps.h \
$(PRJ_DIR)/prjParams.h
romStart.o: $(WIND_BASE)/target/config/comps/src/romStart.c \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stddef.h \
$(PRJ_DIR)/prjComps.h \
$(PRJ_DIR)/prjParams.h \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stdarg.h
usrAppInit.o: $(PRJ_DIR)/usrAppInit.c
prjConfig.o: $(PRJ_DIR)/prjConfig.c \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stddef.h \
$(PRJ_DIR)/prjComps.h \
$(PRJ_DIR)/prjParams.h \
$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/i586-wrs-vxworks/2.9-PentiumIII-010221/include/stdarg.h
linkSyms.o: $(PRJ_DIR)/linkSyms.c
## user defined rules
romStart.o :
$(CC) $(OPTION_OBJECT_ONLY) $(CFLAGS) $(PROJECT_BSP_FLAGS_EXTRA) $(ROM_FLAGS_EXTRA) $< -o $@
romcard_bootrom_512.hex: depend.$(BSP_NAME) romcard.o bootrom_uncmp
- @ $(RM) $@
$(LD) -o romcard -X -N -e _romcard romcard.o
$(ROMSIZEPROG) -b 7fe00 bootrom_uncmp
$(BINHEX) -a 0 bootrom_uncmp | $(SED) -e "/S9/d" > $@
$(BINHEX) -a 7fe00 -b romcard >> $@
- @ $(RM) romcard.o romcard
.............
romcard_vxWorks_st_512.hex: depend.$(BSP_NAME) romcard.o vxWorks.st_rom
- @ $(RM) $@
$(LD) -o romcard -X -N -e _romcard romcard.o
$(ROMSIZEPROG) -b 7fe00 vxWorks.st_rom
$(BINHEX) -a 0 vxWorks.st_rom | $(SED) -e "/S9/d" > $@
$(BINHEX) -a 7fe00 -b romcard >> $@
- @ $(RM) romcard.o romcard
sysALib.o :
$(AS) $(OPTION_OBJECT_ONLY) $(CFLAGS_AS) $(PROJECT_BSP_FLAGS_EXTRA) $(WIND_BASE)/target/config/pcPentium/sysALib.s -o $@
prjConfig.o :
$(CC) $(OPTION_OBJECT_ONLY) $(CFLAGS) $(PROJECT_BSP_FLAGS_EXTRA) $(PRJ_DIR)/prjConfig.c -o $@