You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2015/03/19 01:09:27 UTC

[07/19] lucy-clownfish git commit: Adapt charmonizer for Go bindings.

Adapt charmonizer for Go bindings.

*   Add behaviors when "host" CLI arg is "go".
*   Default "host" CLI arg to "c".
*   Only build static lib when "static" Makefile target is run.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/e1e9a0fc
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/e1e9a0fc
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/e1e9a0fc

Branch: refs/heads/master
Commit: e1e9a0fcc6fdd8d5dd78bf6f9b57fac67cd0a5b1
Parents: 56048a5
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Sat Nov 29 20:53:43 2014 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sun Mar 15 18:05:43 2015 -0700

----------------------------------------------------------------------
 runtime/common/charmonizer.main | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/e1e9a0fc/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 9ef16dc..2f6fe86 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -108,6 +108,9 @@ int main(int argc, const char **argv) {
     if (!chaz_Probe_parse_cli_args(argc, argv, cli)) {
         chaz_Probe_die_usage();
     }
+    if (!chaz_CLI_defined(cli, "host")) {
+        chaz_CLI_set(cli, "host", "c");
+    }
     chaz_Probe_init(cli);
     S_add_compiler_flags(cli);
 
@@ -242,7 +245,16 @@ cfish_MakeFile_new(chaz_CLI *cli) {
     self->autogen_target
         = chaz_Util_join(dir_sep, "autogen", "hierarchy.json", NULL);
 
-    if (strcmp(chaz_CLI_strval(self->cli, "host"), "perl") == 0) {
+    if (strcmp(chaz_CLI_strval(cli, "host"), "go") == 0) {
+        static const char *go_autogen_src_files[] = {
+            "cfish_parcel",
+            "testcfish_parcel",
+            NULL
+        };
+        self->host_src_dir = "ext";
+        self->autogen_src_files = go_autogen_src_files;
+    }
+    else if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) {
         static const char *perl_autogen_src_files[] = {
             "boot",
             "callbacks",
@@ -265,7 +277,7 @@ cfish_MakeFile_new(chaz_CLI *cli) {
 
     self->shared_lib = chaz_Lib_new("cfish", chaz_Lib_SHARED, cfish_version,
                                     cfish_major_version);
-    self->static_lib = chaz_Lib_new("cfish", chaz_Lib_STATIC, cfish_version,
+    self->static_lib = chaz_Lib_new("clownfish", chaz_Lib_STATIC, cfish_version,
                                     cfish_major_version);
     self->shared_lib_filename = chaz_Lib_filename(self->shared_lib);
     self->static_lib_filename = chaz_Lib_filename(self->static_lib);
@@ -357,10 +369,8 @@ cfish_MakeFile_write(cfish_MakeFile *self) {
 
     /* Rules */
 
-    scratch = chaz_Util_join(" ", self->shared_lib_filename,
-                             self->static_lib_filename, NULL);
-    chaz_MakeFile_add_rule(self->makefile, "all", scratch);
-    free(scratch);
+    chaz_MakeFile_add_rule(self->makefile, "all", self->shared_lib_filename);
+    chaz_MakeFile_add_rule(self->makefile, "static", self->static_lib_filename);
 
     if (strcmp(chaz_CLI_strval(self->cli, "host"), "c") == 0) {
         cfish_MakeFile_write_c_cfc_rules(self);