Move string functions to libstring
All checks were successful
Build documentation / build-and-deploy (push) Successful in 27s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 27s
This commit is contained in:
1
Makefile
1
Makefile
@@ -8,3 +8,4 @@ include make/libmsl.mk
|
|||||||
include make/liballoc.mk
|
include make/liballoc.mk
|
||||||
include make/libterminal.mk
|
include make/libterminal.mk
|
||||||
include make/libprocess.mk
|
include make/libprocess.mk
|
||||||
|
include make/libstring.mk
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ make -B all_libmsl
|
|||||||
make -B all_liballoc
|
make -B all_liballoc
|
||||||
make -B all_libprocess
|
make -B all_libprocess
|
||||||
make -B all_libterminal
|
make -B all_libterminal
|
||||||
|
make -B all_libstring
|
||||||
make -B all_apps
|
make -B all_apps
|
||||||
make -B all_dist
|
make -B all_dist
|
||||||
./aux/limine_iso_amd64.sh
|
./aux/limine_iso_amd64.sh
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ make -B format_libmsl
|
|||||||
make -B format_libterminal
|
make -B format_libterminal
|
||||||
make -B format_libprocess
|
make -B format_libprocess
|
||||||
make -B format_liballoc
|
make -B format_liballoc
|
||||||
|
make -B format_libstring
|
||||||
make -B format_apps
|
make -B format_apps
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ include ../make/ufuncs.mk
|
|||||||
$(eval $(call add_lib,libterminal))
|
$(eval $(call add_lib,libterminal))
|
||||||
$(eval $(call add_lib,liballoc))
|
$(eval $(call add_lib,liballoc))
|
||||||
$(eval $(call add_lib,libprocess))
|
$(eval $(call add_lib,libprocess))
|
||||||
|
$(eval $(call add_lib,libstring))
|
||||||
|
|
||||||
include ../make/user.mk
|
include ../make/user.mk
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <process/process.h>
|
#include <process/process.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string/string.h>
|
#include <string.h>
|
||||||
#include <terminal/terminal.h>
|
#include <terminal/terminal.h>
|
||||||
|
|
||||||
#define MUTEX 2000
|
#define MUTEX 2000
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
include $(platform)/src.mk
|
include $(platform)/src.mk
|
||||||
include init/src.mk
|
include init/src.mk
|
||||||
include m/src.mk
|
include m/src.mk
|
||||||
include string/src.mk
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
c += string/string.c
|
|
||||||
|
|
||||||
o += string/string.o
|
|
||||||
28
libstring/Makefile
Normal file
28
libstring/Makefile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
cc := clang
|
||||||
|
o :=
|
||||||
|
c :=
|
||||||
|
cflags := -isystem . -isystem ../libmsl
|
||||||
|
buildtype ?= release
|
||||||
|
|
||||||
|
include src.mk
|
||||||
|
include ../generic/flags.mk
|
||||||
|
include ../$(platform)/flags.mk
|
||||||
|
|
||||||
|
all: build/libstring.a
|
||||||
|
|
||||||
|
build/libstring.a: $(o)
|
||||||
|
llvm-ar rcs $@ $^
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(cc) -c -o $@ $(cflags) $<
|
||||||
|
|
||||||
|
%.o: %.S
|
||||||
|
$(cc) -c -o $@ $(cflags) $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(o) build/libstring.a
|
||||||
|
|
||||||
|
format:
|
||||||
|
clang-format -i $$(git ls-files '*.c' '*.h')
|
||||||
|
|
||||||
|
.PHONY: all clean format
|
||||||
3
libstring/src.mk
Normal file
3
libstring/src.mk
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
c += string.c
|
||||||
|
|
||||||
|
o += string.o
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string/string.h>
|
#include <string.h>
|
||||||
|
|
||||||
size_t memset (void* dst, uint8_t b, size_t n) {
|
size_t memset (void* dst, uint8_t b, size_t n) {
|
||||||
uint8_t* dst1 = dst;
|
uint8_t* dst1 = dst;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _LIBMSL_STRING_STRING_H
|
#ifndef _LIBSTRING_STRING_H
|
||||||
#define _LIBMSL_STRING_STRING_H
|
#define _LIBSTRING_STRING_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -10,4 +10,4 @@ void strncpy (char* dst, const char* src, size_t n);
|
|||||||
size_t strlen (const char* str);
|
size_t strlen (const char* str);
|
||||||
int memcmp (const void* s1, const void* s2, size_t n);
|
int memcmp (const void* s1, const void* s2, size_t n);
|
||||||
|
|
||||||
#endif // _LIBMSL_STRING_STRING_H
|
#endif // _LIBSTRING_STRING_H
|
||||||
10
make/libstring.mk
Normal file
10
make/libstring.mk
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
all_libstring:
|
||||||
|
make -C libstring platform=$(platform) all
|
||||||
|
|
||||||
|
clean_libstring:
|
||||||
|
make -C libstring platform=$(platform) clean
|
||||||
|
|
||||||
|
format_libstring:
|
||||||
|
make -C libstring platform=$(platform) format
|
||||||
|
|
||||||
|
.PHONY: all_libstring clean_libstring format_libstring
|
||||||
Reference in New Issue
Block a user