Use wildcard for *.c files
This commit is contained in:
parent
007c6267ac
commit
6c6f7eb902
2 changed files with 22 additions and 1 deletions
|
|
@ -98,3 +98,24 @@ i32 axl_strcmp(const i8* s1, const i8* s2)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i32 axl_strncmp(const i8* s1, const i8* s2, u32 n)
|
||||||
|
{
|
||||||
|
if (!s1 || !s2)
|
||||||
|
{
|
||||||
|
return (s1 == s2) ? 0 : (!s1 ? -1 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (u32 i = 0; i < n; s1++, s2++)
|
||||||
|
{
|
||||||
|
u8 c1 = *(const u8*)s1;
|
||||||
|
u8 c2 = *(const u8*)s2;
|
||||||
|
|
||||||
|
if (c1 != c2 || c1 == '\0' || c2 == '\0')
|
||||||
|
{
|
||||||
|
return c1 - c2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
2
makefile
2
makefile
|
|
@ -2,7 +2,7 @@ CC = clang
|
||||||
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c11 -nostdlib -static -Oz -ffreestanding
|
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c11 -nostdlib -static -Oz -ffreestanding
|
||||||
LDFLAGS = -Wl,/SUBSYSTEM:CONSOLE,/ENTRY:_start -fuse-ld=lld
|
LDFLAGS = -Wl,/SUBSYSTEM:CONSOLE,/ENTRY:_start -fuse-ld=lld
|
||||||
LIBS = -lkernel32
|
LIBS = -lkernel32
|
||||||
SOURCES = main.c axl_memory.c
|
SOURCES = $(wildcard *.c)
|
||||||
TARGET = prog.exe
|
TARGET = prog.exe
|
||||||
|
|
||||||
all: clean $(TARGET)
|
all: clean $(TARGET)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue