You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/05/16 00:28:37 UTC
[lucy-commits] [03/21] git commit: refs/heads/master - Add version to filename of
shared library
Add version to filename of shared library
Introduce a new Charmonizer class chaz_SharedLib to build various
filenames.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c66d9664
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c66d9664
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c66d9664
Branch: refs/heads/master
Commit: c66d9664cc9bc76c4550cb3c267d79186b253a21
Parents: bec7902
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon May 13 20:23:34 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed May 15 19:13:53 2013 +0200
----------------------------------------------------------------------
c/.gitignore | 4 +-
charmonizer/buildbin/meld.pl | 1 +
charmonizer/src/Charmonizer/Core/CFlags.c | 20 ++-
charmonizer/src/Charmonizer/Core/CFlags.h | 13 +-
charmonizer/src/Charmonizer/Core/Compiler.c | 15 --
charmonizer/src/Charmonizer/Core/Compiler.h | 3 -
charmonizer/src/Charmonizer/Core/Make.c | 27 ++--
charmonizer/src/Charmonizer/Core/Make.h | 7 +-
charmonizer/src/Charmonizer/Core/SharedLibrary.c | 135 +++++++++++++++++
charmonizer/src/Charmonizer/Core/SharedLibrary.h | 66 ++++++++
charmonizer/src/Charmonizer/Probe/Floats.c | 2 +-
common/charmonizer.main | 33 +++--
12 files changed, 266 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/c/.gitignore
----------------------------------------------------------------------
diff --git a/c/.gitignore b/c/.gitignore
index 51675ab..310bb6e 100644
--- a/c/.gitignore
+++ b/c/.gitignore
@@ -2,6 +2,6 @@
/autogen/
/charmonizer
/charmony.h
-/liblucy.dylib
-/liblucy.so
+/liblucy.*.dylib
+/liblucy.so.*
/t/test_lucy
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/buildbin/meld.pl
----------------------------------------------------------------------
diff --git a/charmonizer/buildbin/meld.pl b/charmonizer/buildbin/meld.pl
index 2c73591..a615331 100755
--- a/charmonizer/buildbin/meld.pl
+++ b/charmonizer/buildbin/meld.pl
@@ -67,6 +67,7 @@ if ( !@probes ) {
}
my @core = qw(
+ SharedLibrary
CFlags
Compiler
ConfWriter
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/CFlags.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/CFlags.c b/charmonizer/src/Charmonizer/Core/CFlags.c
index 1651925..4642a99 100644
--- a/charmonizer/src/Charmonizer/Core/CFlags.c
+++ b/charmonizer/src/Charmonizer/Core/CFlags.c
@@ -16,9 +16,10 @@
#include <string.h>
#include <stdlib.h>
-#include "Charmonizer/Core/Flags.h"
+#include "Charmonizer/Core/CFlags.h"
#include "Charmonizer/Core/Util.h"
#include "Charmonizer/Core/OperatingSystem.h"
+#include "Charmonizer/Core/SharedLibrary.h"
struct chaz_CFlags {
int style;
@@ -264,13 +265,26 @@ chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory) {
}
void
-chaz_CFlags_add_library(chaz_CFlags *flags, const char *library) {
+chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib) {
+ char *filename;
+ if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
+ filename = chaz_SharedLib_implib_filename(lib);
+ }
+ else {
+ filename = chaz_SharedLib_filename(lib);
+ }
+ chaz_CFlags_append(flags, filename);
+ free(filename);
+}
+
+void
+chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library) {
char *string;
if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
string = chaz_Util_join("", library, ".lib", NULL);
}
else {
- string = chaz_Util_join("", "-l ", library, NULL);
+ string = chaz_Util_join(" ", "-l", library, NULL);
}
chaz_CFlags_append(flags, string);
free(string);
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/CFlags.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/CFlags.h b/charmonizer/src/Charmonizer/Core/CFlags.h
index 989518f..5f4151d 100644
--- a/charmonizer/src/Charmonizer/Core/CFlags.h
+++ b/charmonizer/src/Charmonizer/Core/CFlags.h
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-/* Charmonizer/Core/Compiler.h
+/* Charmonizer/Core/CFlags.h
*/
-#ifndef H_CHAZ_FLAGS
-#define H_CHAZ_FLAGS
+#ifndef H_CHAZ_CFLAGS
+#define H_CHAZ_CFLAGS
#ifdef __cplusplus
extern "C" {
@@ -83,7 +83,10 @@ void
chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory);
void
-chaz_CFlags_add_library(chaz_CFlags *flags, const char *library);
+chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib);
+
+void
+chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library);
void
chaz_CFlags_enable_code_coverage(chaz_CFlags *flags);
@@ -92,6 +95,6 @@ chaz_CFlags_enable_code_coverage(chaz_CFlags *flags);
}
#endif
-#endif /* H_CHAZ_FLAGS */
+#endif /* H_CHAZ_CFLAGS */
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/Compiler.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Compiler.c b/charmonizer/src/Charmonizer/Core/Compiler.c
index f2683b5..9dd4841 100644
--- a/charmonizer/src/Charmonizer/Core/Compiler.c
+++ b/charmonizer/src/Charmonizer/Core/Compiler.c
@@ -366,19 +366,4 @@ chaz_CC_link_command() {
}
}
-char*
-chaz_CC_shared_lib_file(const char *name) {
- const char *prefix = "";
- const char *shlib_ext = chaz_OS_shared_lib_ext();
- if (!chaz_CC.intval__MSC_VER) {
- if (chaz_OS_is_cygwin()) {
- prefix = "cyg";
- }
- else {
- prefix = "lib";
- }
- }
- return chaz_Util_join("", prefix, name, shlib_ext, NULL);
-}
-
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/Compiler.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Compiler.h b/charmonizer/src/Charmonizer/Core/Compiler.h
index 1e7803f..820f84c 100644
--- a/charmonizer/src/Charmonizer/Core/Compiler.h
+++ b/charmonizer/src/Charmonizer/Core/Compiler.h
@@ -108,9 +108,6 @@ chaz_CC_msvc_version_num(void);
const char*
chaz_CC_link_command(void);
-char*
-chaz_CC_shared_lib_file(const char *name);
-
#ifdef __cplusplus
}
#endif
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.c b/charmonizer/src/Charmonizer/Core/Make.c
index f114a37..410254e 100644
--- a/charmonizer/src/Charmonizer/Core/Make.c
+++ b/charmonizer/src/Charmonizer/Core/Make.c
@@ -321,7 +321,7 @@ chaz_MakeFile_add_compiled_exe(chaz_MakeFile *makefile, const char *exe,
}
chaz_MakeRule*
-chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
+chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, chaz_SharedLib *lib,
const char *sources, chaz_CFlags *link_flags) {
int cflags_style = chaz_CC_get_cflags_style();
chaz_CFlags *local_flags = chaz_CFlags_new(cflags_style);
@@ -329,37 +329,36 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
const char *link_flags_string = "";
const char *local_flags_string;
chaz_MakeRule *rule;
- char *shared_lib;
+ char *filename;
char *command;
- shared_lib = chaz_CC_shared_lib_file(name);
- rule = chaz_MakeFile_add_rule(makefile, shared_lib, sources);
+ filename = chaz_SharedLib_filename(lib);
+ rule = chaz_MakeFile_add_rule(makefile, filename, sources);
if (link_flags) {
link_flags_string = chaz_CFlags_get_string(link_flags);
}
chaz_CFlags_link_shared_library(local_flags);
- chaz_CFlags_set_link_output(local_flags, shared_lib);
+ chaz_CFlags_set_link_output(local_flags, filename);
local_flags_string = chaz_CFlags_get_string(local_flags);
command = chaz_Util_join(" ", link, sources, link_flags_string,
local_flags_string, NULL);
chaz_MakeRule_add_command(rule, command);
- chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
+ chaz_MakeRule_add_rm_command(makefile->clean, filename);
if (chaz_CC_msvc_version_num()) {
/* Remove import library and export file under MSVC. */
- char *filename;
- filename = chaz_Util_join("", name, ".lib", NULL);
- chaz_MakeRule_add_rm_command(makefile->clean, filename);
- free(filename);
- filename = chaz_Util_join("", name, ".exp", NULL);
- chaz_MakeRule_add_rm_command(makefile->clean, filename);
- free(filename);
+ char *lib_filename = chaz_SharedLib_implib_filename(lib);
+ char *exp_filename = chaz_SharedLib_export_filename(lib);
+ chaz_MakeRule_add_rm_command(makefile->clean, lib_filename);
+ chaz_MakeRule_add_rm_command(makefile->clean, exp_filename);
+ free(lib_filename);
+ free(exp_filename);
}
chaz_CFlags_destroy(local_flags);
- free(shared_lib);
+ free(filename);
free(command);
return rule;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/Make.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.h b/charmonizer/src/Charmonizer/Core/Make.h
index 8df49f6..8f2cbc1 100644
--- a/charmonizer/src/Charmonizer/Core/Make.h
+++ b/charmonizer/src/Charmonizer/Core/Make.h
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* Charmonizer/Core/Compiler.h
+/* Charmonizer/Core/Make.h
*/
#ifndef H_CHAZ_MAKE
@@ -25,6 +25,7 @@ extern "C" {
#endif
#include "Charmonizer/Core/CFlags.h"
+#include "Charmonizer/Core/SharedLib.h"
typedef struct chaz_MakeFile chaz_MakeFile;
typedef struct chaz_MakeVar chaz_MakeVar;
@@ -141,12 +142,12 @@ chaz_MakeFile_add_compiled_exe(chaz_MakeFile *makefile, const char *exe,
* to the list of files to clean.
*
* @param makefile The makefile.
- * @param name The name of the shared library without prefix or extension.
+ * @param lib The shared library.
* @param sources The list of source files.
* @param link_flags Additional link flags.
*/
chaz_MakeRule*
-chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
+chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, chaz_SharedLib *lib,
const char *sources, chaz_CFlags *link_flags);
/** Write the makefile to a file named 'Makefile' in the current directory.
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/SharedLibrary.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/SharedLibrary.c b/charmonizer/src/Charmonizer/Core/SharedLibrary.c
new file mode 100644
index 0000000..5c9d0e9
--- /dev/null
+++ b/charmonizer/src/Charmonizer/Core/SharedLibrary.c
@@ -0,0 +1,135 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include "Charmonizer/Core/SharedLib.h"
+#include "Charmonizer/Core/Compiler.h"
+#include "Charmonizer/Core/Util.h"
+#include "Charmonizer/Core/OperatingSystem.h"
+
+struct chaz_SharedLib {
+ char *name;
+ char *version;
+ char *major_version;
+};
+
+static char*
+S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext);
+
+static const char*
+S_get_prefix(void);
+
+chaz_SharedLib*
+chaz_SharedLib_new(const char *name, const char *version,
+ const char *major_version) {
+ chaz_SharedLib *lib = (chaz_SharedLib*)malloc(sizeof(chaz_SharedLib));
+ lib->name = chaz_Util_strdup(name);
+ lib->version = chaz_Util_strdup(version);
+ lib->major_version = chaz_Util_strdup(major_version);
+ return lib;
+}
+
+void
+chaz_SharedLib_destroy(chaz_SharedLib *lib) {
+ free(lib->name);
+ free(lib->version);
+ free(lib->major_version);
+ free(lib);
+}
+
+const char*
+chaz_SharedLib_get_name(chaz_SharedLib *lib) {
+ return lib->name;
+}
+
+const char*
+chaz_SharedLib_get_version(chaz_SharedLib *lib) {
+ return lib->version;
+}
+
+const char*
+chaz_SharedLib_get_major_version(chaz_SharedLib *lib) {
+ return lib->major_version;
+}
+
+char*
+chaz_SharedLib_filename(chaz_SharedLib *lib) {
+ const char *shlib_ext = chaz_OS_shared_lib_ext();
+
+ if (strcmp(shlib_ext, ".dll") == 0) {
+ return S_build_filename(lib, lib->major_version, shlib_ext);
+ }
+ else {
+ return S_build_filename(lib, lib->version, shlib_ext);
+ }
+}
+
+char*
+chaz_SharedLib_major_version_filename(chaz_SharedLib *lib) {
+ const char *shlib_ext = chaz_OS_shared_lib_ext();
+
+ return S_build_filename(lib, lib->major_version, shlib_ext);
+}
+
+char*
+chaz_SharedLib_no_version_filename(chaz_SharedLib *lib) {
+ const char *prefix = S_get_prefix();
+ const char *shlib_ext = chaz_OS_shared_lib_ext();
+
+ return chaz_Util_join("", prefix, lib->name, shlib_ext, NULL);
+}
+
+char*
+chaz_SharedLib_implib_filename(chaz_SharedLib *lib) {
+ return S_build_filename(lib, lib->major_version, ".lib");
+}
+
+char*
+chaz_SharedLib_export_filename(chaz_SharedLib *lib) {
+ return S_build_filename(lib, lib->major_version, ".exp");
+}
+
+static char*
+S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext) {
+ const char *prefix = S_get_prefix();
+ const char *shlib_ext = chaz_OS_shared_lib_ext();
+
+ if (strcmp(shlib_ext, ".dll") == 0) {
+ return chaz_Util_join("", prefix, lib->name, "-", version, ext, NULL);
+ }
+ else if (strcmp(shlib_ext, ".dylib") == 0) {
+ return chaz_Util_join("", prefix, lib->name, ".", version, ext, NULL);
+ }
+ else {
+ return chaz_Util_join("", prefix, lib->name, ext, ".", version, NULL);
+ }
+}
+
+static const char*
+S_get_prefix() {
+ if (chaz_CC_msvc_version_num()) {
+ return "";
+ }
+ else if (chaz_OS_is_cygwin()) {
+ return "cyg";
+ }
+ else {
+ return "lib";
+ }
+}
+
+
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Core/SharedLibrary.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/SharedLibrary.h b/charmonizer/src/Charmonizer/Core/SharedLibrary.h
new file mode 100644
index 0000000..723f407
--- /dev/null
+++ b/charmonizer/src/Charmonizer/Core/SharedLibrary.h
@@ -0,0 +1,66 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Charmonizer/Core/SharedLibrary.h
+ */
+
+#ifndef H_CHAZ_SHARED_LIB
+#define H_CHAZ_SHARED_LIB
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct chaz_SharedLib chaz_SharedLib;
+
+chaz_SharedLib*
+chaz_SharedLib_new(const char *name, const char *version,
+ const char *major_version);
+
+void
+chaz_SharedLib_destroy(chaz_SharedLib *flags);
+
+const char*
+chaz_SharedLib_get_name(chaz_SharedLib *lib);
+
+const char*
+chaz_SharedLib_get_version(chaz_SharedLib *lib);
+
+const char*
+chaz_SharedLib_get_major_version(chaz_SharedLib *lib);
+
+char*
+chaz_SharedLib_filename(chaz_SharedLib *lib);
+
+char*
+chaz_SharedLib_major_version_filename(chaz_SharedLib *lib);
+
+char*
+chaz_SharedLib_no_version_filename(chaz_SharedLib *lib);
+
+char*
+chaz_SharedLib_implib_filename(chaz_SharedLib *lib);
+
+char*
+chaz_SharedLib_export_filename(chaz_SharedLib *lib);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H_CHAZ_SHARED_LIB */
+
+
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/charmonizer/src/Charmonizer/Probe/Floats.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Floats.c b/charmonizer/src/Charmonizer/Probe/Floats.c
index fc31386..b78ec00 100644
--- a/charmonizer/src/Charmonizer/Probe/Floats.c
+++ b/charmonizer/src/Charmonizer/Probe/Floats.c
@@ -67,7 +67,7 @@ chaz_Floats_math_library(void) {
return NULL;
}
- chaz_CFlags_add_library(temp_cflags, "m");
+ chaz_CFlags_add_external_library(temp_cflags, "m");
output = chaz_CC_capture_output(sqrt_code, &output_len);
chaz_CFlags_clear(temp_cflags);
http://git-wip-us.apache.org/repos/asf/lucy/blob/c66d9664/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 0460724..0642089 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -49,6 +49,9 @@ typedef struct SourceFileContext {
const char *dir;
} SourceFileContext;
+static const char lucy_version[] = "0.3.0";
+static const char lucy_major_version[] = "0.3";
+
static void
S_add_compiler_flags(struct chaz_CLIArgs *args) {
chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
@@ -147,8 +150,6 @@ S_write_makefile(struct chaz_CLIArgs *args) {
const char *json_parser_c = "$(CORE_DIR)" DIR_SEP "Lucy" DIR_SEP "Util"
DIR_SEP "Json" DIR_SEP "JsonParser.c";
- char *scratch;
-
chaz_MakeFile *makefile;
chaz_MakeVar *var;
chaz_MakeRule *rule;
@@ -161,9 +162,12 @@ S_write_makefile(struct chaz_CLIArgs *args) {
chaz_CFlags *lemon_cflags;
chaz_CFlags *link_flags;
chaz_CFlags *test_cflags;
- const char *math_library;
- const char *test_command;
- char *shared_lib;
+
+ chaz_SharedLib *lib;
+ const char *math_library;
+ const char *test_command;
+ char *lib_filename;
+ char *scratch;
printf("Creating Makefile...\n");
@@ -282,8 +286,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
/* Rules */
- shared_lib = chaz_CC_shared_lib_file("lucy");
- chaz_MakeFile_add_rule(makefile, "all", shared_lib);
+ lib = chaz_SharedLib_new("lucy", lucy_version, lucy_major_version);
+ lib_filename = chaz_SharedLib_filename(lib);
+ chaz_MakeFile_add_rule(makefile, "all", lib_filename);
lemon_cflags = chaz_CFlags_new(cflags_style);
S_add_common_cflags(lemon_cflags);
@@ -325,15 +330,15 @@ S_write_makefile(struct chaz_CLIArgs *args) {
}
math_library = chaz_Floats_math_library();
if (math_library) {
- chaz_CFlags_add_library(link_flags, math_library);
+ chaz_CFlags_add_external_library(link_flags, math_library);
}
if (chaz_HeadCheck_check_header("pcre.h")) {
- chaz_CFlags_add_library(link_flags, "pcre");
+ chaz_CFlags_add_external_library(link_flags, "pcre");
}
if (args->code_coverage) {
chaz_CFlags_enable_code_coverage(link_flags);
}
- chaz_MakeFile_add_shared_lib(makefile, "lucy", "$(LUCY_OBJS)", link_flags);
+ chaz_MakeFile_add_shared_lib(makefile, lib, "$(LUCY_OBJS)", link_flags);
chaz_CFlags_destroy(link_flags);
test_cflags = chaz_CFlags_new(cflags_style);
@@ -341,12 +346,11 @@ S_write_makefile(struct chaz_CLIArgs *args) {
chaz_CFlags_add_include_dir(test_cflags, ".");
chaz_CFlags_add_include_dir(test_cflags,
"$(AUTOGEN_DIR)" DIR_SEP "include");
- chaz_CFlags_add_library_path(test_cflags, ".");
- chaz_CFlags_add_library(test_cflags, "lucy");
+ chaz_CFlags_add_library(link_flags, lib);
rule = chaz_MakeFile_add_compiled_exe(makefile, "$(TEST_LUCY_EXE)",
"t" DIR_SEP "test_lucy.c",
test_cflags);
- chaz_MakeRule_add_prereq(rule, shared_lib);
+ chaz_MakeRule_add_prereq(rule, lib_filename);
chaz_CFlags_destroy(test_cflags);
rule = chaz_MakeFile_add_rule(makefile, "test", "$(TEST_LUCY_EXE)");
@@ -409,7 +413,8 @@ S_write_makefile(struct chaz_CLIArgs *args) {
chaz_MakeFile_write(makefile);
chaz_MakeFile_destroy(makefile);
- free(shared_lib);
+ chaz_SharedLib_destroy(lib);
+ free(lib_filename);
}
int main(int argc, const char **argv) {