lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/2] git commit: refs/heads/master - Generate a Lucy static lib in addition to a DSO.
Date Thu, 09 Oct 2014 01:17:33 GMT
Generate a Lucy static lib in addition to a DSO.


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

Branch: refs/heads/master
Commit: 717efbf2e9ad53638426769e3b3e5cda3ca91902
Parents: 18e6962
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Wed Oct 8 18:08:21 2014 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Wed Oct 8 18:17:11 2014 -0700

----------------------------------------------------------------------
 common/charmonizer.main | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/717efbf2/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 828c7d3..c12b3c4 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -180,13 +180,15 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     chaz_CFlags *link_flags;
     chaz_CFlags *test_cflags;
 
-    chaz_SharedLib *lib;
+    chaz_Lib *shared_lib;
+    chaz_Lib *static_lib;
 
     const char *cfish_lib_name = NULL;
     char       *cfish_lib_dir  = NULL;
-    char       *lib_filename   = NULL;
     char       *test_command   = NULL;
     char       *scratch        = NULL;
+    char       *shared_lib_filename = NULL;
+    char       *static_lib_filename = NULL;
 
     printf("Creating Makefile...\n");
 
@@ -257,9 +259,16 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
 
     /* Rules */
 
-    lib = chaz_SharedLib_new("lucy", lucy_version, lucy_major_version);
-    lib_filename = chaz_SharedLib_filename(lib);
-    chaz_MakeFile_add_rule(makefile, "all", lib_filename);
+    shared_lib = chaz_Lib_new("lucy", chaz_Lib_SHARED, lucy_version,
+                              lucy_major_version);
+    shared_lib_filename = chaz_Lib_filename(shared_lib);
+    static_lib = chaz_Lib_new("lucy", chaz_Lib_STATIC, lucy_version,
+                              lucy_major_version);
+    static_lib_filename = chaz_Lib_filename(static_lib);
+    scratch = chaz_Util_join(" ", shared_lib_filename, static_lib_filename,
+                             NULL);
+    chaz_MakeFile_add_rule(makefile, "all", scratch);
+    free(scratch);
 
     chaz_MakeFile_add_lemon_exe(makefile, lemon_dir);
     chaz_MakeFile_add_lemon_grammar(makefile, json_parser);
@@ -325,14 +334,15 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     if (chaz_args->code_coverage) {
         chaz_CFlags_enable_code_coverage(link_flags);
     }
-    rule = chaz_MakeFile_add_shared_lib(makefile, lib, "$(LUCY_OBJS)",
+    rule = chaz_MakeFile_add_shared_lib(makefile, shared_lib, "$(LUCY_OBJS)",
                                         link_flags);
     chaz_CFlags_destroy(link_flags);
+    chaz_MakeFile_add_static_lib(makefile, static_lib, "$(LUCY_OBJS)");
 
     test_cflags = chaz_CC_new_cflags();
     chaz_CFlags_enable_optimization(test_cflags);
     chaz_CFlags_add_include_dir(test_cflags, autogen_inc_dir);
-    chaz_CFlags_add_library(test_cflags, lib);
+    chaz_CFlags_add_library(test_cflags, shared_lib);
     if (cfish_lib_dir) {
         chaz_CFlags_add_library_path(link_flags, cfish_lib_dir);
     }
@@ -341,7 +351,7 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     rule = chaz_MakeFile_add_compiled_exe(makefile, test_lucy_exe, scratch,
                                           test_cflags);
     free(scratch);
-    chaz_MakeRule_add_prereq(rule, lib_filename);
+    chaz_MakeRule_add_prereq(rule, shared_lib_filename);
     chaz_CFlags_destroy(test_cflags);
 
     rule = chaz_MakeFile_add_rule(makefile, "test", test_lucy_exe);
@@ -412,7 +422,8 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     chaz_MakeFile_write(makefile);
 
     chaz_MakeFile_destroy(makefile);
-    chaz_SharedLib_destroy(lib);
+    chaz_Lib_destroy(shared_lib);
+    chaz_Lib_destroy(static_lib);
     free(core_dir);
     free(lemon_dir);
     free(modules_dir);
@@ -426,7 +437,8 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     free(autogen_target);
     free(snowstem_inc_dir);
     free(cfish_lib_dir);
-    free(lib_filename);
+    free(shared_lib_filename);
+    free(static_lib_filename);
     free(test_command);
 }
 


Mime
View raw message