关于XDC的那些破事

目前在我看来XDC就是TI搞出来的一套编译工具,特点就是多平台。

我要做得就是去好好使用它,一个.c  一个.cfg   我要做的就是这些。

先看看mycfg.cfg

var System = xdc.useModule("xdc.runtime.System");
就这么简单。

然后xs xdc.tools.configuro -t targets -p platforms -c ... mycfg.cfg

使用这个工具会生成一个子目录,mycfg:

newton@ubuntu:~/workspace/workshop/test/mycfg$ ls
config.bld  custom.mak  linker.cmd  package  package.bld  package.mak  package.xdc  package.xs
其中compiler.opt是用来编译源文件用的,linker.cmd是用来链接用的。

再看看Makefile:

CGTOOLS = /usr CC = $(CGTOOLS)/bin/gcc LNK = $(CGTOOLS)/bin/gcc RTS = -lstdc++ CONFIG = mycfg XDCTARGET = gnu.targets.Linux86 %/linker.cmd %/compiler.opt : %.cfg xs xdc.tools.configuro -c $(CGTOOLS) -t $(XDCTARGET) $< %.o : %.c %.o : %.c $(CONFIG)/compiler.opt $(CC) $(shell cat $(CONFIG)/compiler.opt) -c $< hello:hello.o $(CONFIG)/linker.cmd $(LNK) -o $@ hello.o $(CONFIG)/linker.cmd $(RTS)

我还说不明白  呜呜

你可能感兴趣的:(关于XDC的那些破事)