From: Ramsey Harris Date: Wed, 26 Nov 2014 18:29:00 +0000 (-0800) Subject: SDOCM00114108 IPC custom build failure with XDCtools core product X-Git-Tag: 3.30.02.13~2 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=79ddce25f3402c081fb5fc0f815985ae56445687 SDOCM00114108 IPC custom build failure with XDCtools core product When building with the XDCtools core product, the IPC custom build was not finding the target header files. Build include path based on package path, not from explicit repository names. This will ensure correct include path as new repositories are added to or removed from the package path. --- diff --git a/packages/ti/sdo/ipc/makefile.xdt b/packages/ti/sdo/ipc/makefile.xdt index bfdd73f..40646fb 100644 --- a/packages/ti/sdo/ipc/makefile.xdt +++ b/packages/ti/sdo/ipc/makefile.xdt @@ -58,17 +58,34 @@ XOPTS = `'-I"' + XDCROOT + '"' + " -Dxdc_target_types__=" + File.getDOSPath(TARG CCOPTS = `Build.getCCOpts(TARGET.name)` -XDC_ROOT = `XDCROOT` - IPC_ROOT = `File.getDOSPath(this.$package.packageRepository) + "ti/sdo/"` BUILD_DEFS = `Build.getDefs()` -BIOS_INC = -I"`xdc.getPackageRepository("ti.sysbios")`" - -IPC_INC = -I"`xdc.getPackageRepository("ti.sdo.ipc")`" - -UTILS_INC = -I"`xdc.getPackageRepository("ti.sdo.utils")`" +%%{ + /* convert package path into include path */ + var incs = new Array(); + incs.push("-I" + this.$package.packageRepository.replace(/\/$/, "")); + + for each (var repo in xdc.curPath().split(';')) { + /* skip empty repo, relative paths, and xdctools itself */ + if ((repo == "") || repo.match(/^\./) || repo.match(/xdctools/)) { + continue; + } + + /* add repo if not already present in array */ + var i; + for (i = 0; i < incs.length; i++) { + if (incs[i] == "-I" + repo) { + break; + } + } + if (i == incs.length) { + incs.push("-I" + repo); + } + } +%%} +INCS = `incs.join(" ")` %if (TARGET.$name.match(/gnu/)) { CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include @@ -101,7 +118,7 @@ endef define ASSEMBLE @echo asm`TARGET.suffix` $< ... - @$(ASM) $(BUILD_DEFS) $(XOPTS) $(IPC_INC) $< + @$(ASM) $(BUILD_DEFS) $(XOPTS) $(INCS) $< endef %var LIB = "ipc.a" + TARGET.suffix; @@ -144,13 +161,12 @@ Ipc.obj: `CFILES` makefile @-$(call RM, $@) %} @echo cl`TARGET.suffix` $< ... - @$(CC) $(BUILD_DEFS) $(XOPTS) $(BIOS_INC) \ - $(IPC_INC) $(UTILS_INC) \ + @$(CC) $(BUILD_DEFS) $(XOPTS) $(INCS) \ %var sources = CFILES.split(' '); %for (var i = 0; i < sources.length; i++) { % var s = sources[i] + (i == (sources.length - 1) ? "" : " \\"); % if (s.substring(0,4) == "xdc/") { - $(XDC_ROOT)`s` + `XDCROOT``s` % } else if (s.substring(0,2) == "./") { `s` % } else { diff --git a/packages/ti/sdo/ipc/makefile_gccArmLto.xdt b/packages/ti/sdo/ipc/makefile_gccArmLto.xdt index 3876d17..a482c8c 100644 --- a/packages/ti/sdo/ipc/makefile_gccArmLto.xdt +++ b/packages/ti/sdo/ipc/makefile_gccArmLto.xdt @@ -33,17 +33,13 @@ %%} %%{ var File = xdc.module("xdc.services.io.File"); - var BIOS = xdc.module("ti.sysbios.BIOS"); - var Build = xdc.module("ti.sdo.ipc.Build"); - var TARGET = $args[0]; - var XDCROOT = String(environment['xdc.rootDir'] + '/packages/').replace(/\\/g, "/"); - var XOPTS = '-I "' + XDCROOT + '"' - + " -Dxdc_target_types__=" + File.getDOSPath(TARGET.$package.packageRepository) + TARGET.stdInclude + var XOPTS = '-I "' + XDCROOT + '"' + " -Dxdc_target_types__=" + + File.getDOSPath(TARGET.$package.packageRepository) + TARGET.stdInclude + " -Dxdc_target_name__=" + TARGET.name; var CGEN = TARGET.rootDir.replace(/\\/g, "/"); @@ -61,18 +57,34 @@ vpath % `File.getDOSPath(this.$package.packageRepository) + "ti/sdo/"` vpath %.c `XDCROOT` -CCOPTS = `Build.getCCOpts(TARGET.$name)` - -XDC_ROOT = `XDCROOT` +CCOPTS = `Build.getCCOpts(TARGET.$name)` BUILD_DEFS = `Build.getDefs()` -BIOS_INC = -I"`xdc.getPackageRepository("ti.sysbios")`" - -IPC_INC = -I"`xdc.getPackageRepository("ti.sdo.ipc")`" - -UTILS_INC = -I"`xdc.getPackageRepository("ti.sdo.utils")`" - +%%{ + /* convert package path into include path */ + var incs = new Array(); + incs.push("-I" + this.$package.packageRepository.replace(/\/$/, "")); + + for each (var repo in xdc.curPath().split(';')) { + /* skip empty repo, relative paths, and xdctools itself */ + if ((repo == "") || repo.match(/^\./) || repo.match(/xdctools/)) { + continue; + } + + /* add repo if not already present in array */ + var i; + for (i = 0; i < incs.length; i++) { + if (incs[i] == "-I" + repo) { + break; + } + } + if (i == incs.length) { + incs.push("-I" + repo); + } + } +%%} +INCS = `incs.join(" ")` CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include ASM = `CGEN`/`TARGET.asmBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include @@ -96,12 +108,12 @@ endef define ASSEMBLE @echo asm`TARGET.suffix` $< ... - @$(ASM) $(BUILD_DEFS) `XOPTS` $(BIOS_INC) $< + @$(ASM) $(BUILD_DEFS) `XOPTS` $(INCS) $< endef define COMPILE @echo cl`TARGET.suffix` $< ... - @$(CC) $(BUILD_DEFS) `XOPTS` $(BIOS_INC) $(IPC_INC) $(UTILS_INC) $< + @$(CC) $(BUILD_DEFS) `XOPTS` $(INCS) $< endef %var LIB = "ipc.a" + TARGET.suffix;