diff --git a/Makefile b/Makefile index 7ff6614..a779750 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ endif #======================= CFLAGS += -Iinclude -Ilib +CFLAGS += -Llib -lxy ifeq ($(On-Windows), 1) CLANG_FLAGS = -target x86_64-pc-windows-gnu @@ -71,6 +72,14 @@ all: CI: all @mv $(Target-Name) $(CI_ARTIFACT_NAME) +libxy: lib/libxy.a lib/libxy.so +lib/libxy.a: + @cd lib; $(CC) -c $(_C_Warning_Flags) xy.c; $(AR) rcs libxy.a xy.o + @echo Compile done: libxy.a +lib/libxy.so: + @cd lib; $(CC) -fPIC -shared -o libxy.so xy.c + @echo Compile done: libxy.so + debug: CFLAGS += -g debug: all @@ -78,7 +87,7 @@ debug: all test: test-xy test-fw -test-xy: +test-xy: libxy @$(CC) test/xy.c $(CFLAGS) -o xy @./xy diff --git a/lib/xy.h b/lib/xy.h index 6f40ca2..c7ed53a 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -107,7 +107,7 @@ void p (const char *s); /****************************************************** * Memory ******************************************************/ -inline void * xy_malloc0 (size_t size); +void * xy_malloc0 (size_t size); diff --git a/test/xy.c b/test/xy.c index d342e9b..28338c0 100644 --- a/test/xy.c +++ b/test/xy.c @@ -8,7 +8,7 @@ * Created On : <2023-08-30> * Last Modified : <2024-12-14> * - * Test xy.h + * Test xy * ------------------------------------------------------------*/ #include "xy.h" @@ -89,8 +89,8 @@ main (int argc, char const *argv[]) assert (xy_dir_exist ("~")); if (xy_on_windows) { - assert (xy_file_exist (xy_win_powershell_profile)); - assert (true == xy_file_exist (xy_win_powershellv5_profile)); + assert (xy_file_exist (xy_win_powershell_profile())); + assert (true == xy_file_exist (xy_win_powershellv5_profile())); assert (xy_dir_exist ("C:\\Users")); } else