spkg: Add support package groundwork
Signed-off-by: Chloe M. <chloe@yiffware.org>
This commit is contained in:
@@ -9,12 +9,16 @@
|
|||||||
include ../mk/ptos.mk
|
include ../mk/ptos.mk
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: ke machine
|
all: spkg ke machine
|
||||||
|
|
||||||
.PHONY: ke
|
.PHONY: ke
|
||||||
ke:
|
ke:
|
||||||
cd ke/; $(MAKE) $(PASSDOWN_ARGS)
|
cd ke/; $(MAKE) $(PASSDOWN_ARGS)
|
||||||
|
|
||||||
|
.PHONY: spkg
|
||||||
|
spkg:
|
||||||
|
cd ../spkg/; $(MAKE) $(PASSDOWN_ARGS)
|
||||||
|
|
||||||
.PHONY: machine
|
.PHONY: machine
|
||||||
machine:
|
machine:
|
||||||
cd arch/$(PT_TARGET_ARCH)/; $(MAKE) $(PASSDOWN_ARGS)
|
cd arch/$(PT_TARGET_ARCH)/; $(MAKE) $(PASSDOWN_ARGS)
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2026, Chloe M.
|
||||||
|
# Provided under the BSD-3 clause
|
||||||
|
#
|
||||||
|
# Description: Support package build script
|
||||||
|
# Author: Chloe M.
|
||||||
|
#
|
||||||
|
|
||||||
|
include ../mk/ptos.mk
|
||||||
|
|
||||||
|
CFILES = $(shell find . -name "*.c")
|
||||||
|
OFILES = $(CFILES:.c=.o)
|
||||||
|
DFILES = $(CFILES:.c=.d)
|
||||||
|
|
||||||
|
CFLAGS = \
|
||||||
|
$(SYS_CFLAGS) \
|
||||||
|
-MMD \
|
||||||
|
-I$(PT_PROJECT_ROOT)/sdk/head
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: $(OFILES)
|
||||||
|
|
||||||
|
-include $(DFILES)
|
||||||
|
%.o: %.c
|
||||||
|
$(PROMPT) "CC" $<
|
||||||
|
$(SYS_CC) -c $(CFLAGS) $< -o $@
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026, Chloe M., et al
|
||||||
|
* Provided under the BSD-3 clause.
|
||||||
|
*
|
||||||
|
* Description: String libraries
|
||||||
|
* Author: Chloe M.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SPKG_STRING_H_
|
||||||
|
#define _SPKG_STRING_H_ 1
|
||||||
|
|
||||||
|
#include <ptdef.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Obtain the length of a string
|
||||||
|
*
|
||||||
|
* @String: String to obtain length of
|
||||||
|
*/
|
||||||
|
USIZE RtlStrLen(const CHAR *String);
|
||||||
|
|
||||||
|
#endif /* !_SPKG_STRING_H_ */
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026, Chloe M., et al
|
||||||
|
* Provided under the BSD-3 clause.
|
||||||
|
*
|
||||||
|
* Description: Obtain length of string
|
||||||
|
* Author: Chloe M.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ptdef.h>
|
||||||
|
|
||||||
|
USIZE
|
||||||
|
RtlStrLen(const CHAR *String)
|
||||||
|
{
|
||||||
|
USIZE Length = 0;
|
||||||
|
|
||||||
|
if (String == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (String[Length++] != '\0');
|
||||||
|
return Length;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user