You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2018/12/11 00:40:58 UTC

[mynewt-newt] 03/03: Inject target name into syscfg

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 4b02fd13adb5f288b4212e3a0482412a4c979c96
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Thu Dec 6 17:16:12 2018 -0800

    Inject target name into syscfg
    
    Newt injects the following settings into syscfg:
        TARGET_<target-name> = 1
        TARGET_NAME = "<target-name>"
---
 newt/builder/targetbuild.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index ed2416b..3f10dbb 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -141,6 +141,10 @@ func (t *TargetBuilder) injectBuildSettings() {
 	bspName := filepath.Base(t.bspPkg.Name())
 	t.InjectSetting("BSP_NAME", "\""+bspName+"\"")
 	t.InjectSetting("BSP_"+util.CIdentifier(bspName), "1")
+
+	tgtName := filepath.Base(t.target.Name())
+	t.InjectSetting("TARGET_NAME", "\""+tgtName+"\"")
+	t.InjectSetting("TARGET_"+util.CIdentifier(tgtName), "1")
 }
 
 func (t *TargetBuilder) ensureResolved() error {