Update Makefile

This commit is contained in:
Aoran Zeng 2025-03-06 17:03:54 +08:00
parent 8d35bcd24d
commit e88fae30b7
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
3 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -107,7 +107,7 @@ void p (const char *s);
/******************************************************
* Memory
******************************************************/
inline void * xy_malloc0 (size_t size);
void * xy_malloc0 (size_t size);

View File

@ -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