编写vxworks的MakeFile

MakeFile文件内容如下

CPU = XXX1000 <<CPU类型

TOOL = gnu <<用gcc编译

ADDED_CFLAGS
= -g <<g表示生成用于Debug的目标文件

TARGET = target.o << 目标文件

OBJS = example1.o ¥ << 目标文件由Example1和2.o连接而成

example2.o ¥

$(TARGET):$(OBJS)

$(LD) -r -o $@ $(OBJS)

example1.o : example1.h << 当头文件变更时重新编译example.o

example2.o
: example2.h

include
$(WIND_BASE)/target/h/make/defs.bsp <<以下是链接中使用的文件

include
$(WIND_BASE)/target/h/make/make.$(CPU)$(TOOL)

include
$(WIND_BASE)/target/h/make/defs.$(WIND_HOST_TYPE)

include
$(WIND_BASE)/target/h/make/rules.bsp

编译用的批处理文件Link.bat

del *.o
set WIND_HOST_TYPE=x86-win32 <<设置相应的环境变量
set WIND_BASE=c:\Tornado
path C:\Tornado\host\x86-win32\bin
make -f Makefile
PAUSE