Add a static library target for CFC.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/783e8522 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/783e8522 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/783e8522 Branch: refs/heads/go_bindings_2 Commit: 783e8522d23fc25c6998fe5b4ece57efed5143a9 Parents: f013755 Author: Marvin Humphrey <[email protected]> Authored: Sat Nov 29 14:02:14 2014 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Sat Nov 29 14:07:54 2014 -0800 ---------------------------------------------------------------------- compiler/common/charmonizer.main | 15 +++++++++++++++ 1 file changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/783e8522/compiler/common/charmonizer.main ---------------------------------------------------------------------- diff --git a/compiler/common/charmonizer.main b/compiler/common/charmonizer.main index 5df4536..9cc6bfc 100644 --- a/compiler/common/charmonizer.main +++ b/compiler/common/charmonizer.main @@ -29,6 +29,9 @@ typedef struct SourceFileContext { chaz_MakeVar *common_test_objs; } SourceFileContext; +static const char cfc_version[] = "0.4.0"; +static const char cfc_major_version[] = "0.4"; + static void S_add_compiler_flags(struct chaz_CLI *cli); @@ -119,6 +122,17 @@ S_add_compiler_flags(struct chaz_CLI *cli) { } static void +S_add_staticlib_makefile_target(chaz_MakeFile *makefile) { + chaz_Lib *static_lib = chaz_Lib_new("cfc", chaz_Lib_STATIC, cfc_version, + cfc_major_version); + char *static_lib_filename = chaz_Lib_filename(static_lib); + chaz_MakeFile_add_rule(makefile, "static", static_lib_filename); + chaz_MakeFile_add_static_lib(makefile, static_lib, "$(COMMON_OBJS)"); + free(static_lib_filename); + chaz_Lib_destroy(static_lib); +} + +static void S_write_makefile(struct chaz_CLI *cli) { SourceFileContext sfc; @@ -201,6 +215,7 @@ S_write_makefile(struct chaz_CLI *cli) { /* Rules */ chaz_MakeFile_add_rule(makefile, "all", cfc_exe); + S_add_staticlib_makefile_target(makefile); chaz_MakeFile_add_lemon_exe(makefile, lemon_dir); chaz_MakeFile_add_lemon_grammar(makefile, parse_header);
