kolibri-libc:

- Added mkexp binary
- Deleted exports.c
- Fixed mkexp and added to Makefile

git-svn-id: svn://kolibrios.org@8640 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-03-09 09:09:11 +00:00
parent c28876a891
commit 549ba491fa
4 changed files with 12 additions and 137 deletions

Binary file not shown.

View File

@ -25,19 +25,18 @@ int main(int argc, char** argv) {
"#include <stdlib.h>\n" \
"#include <time.h>\n" \
"#include <sys/dirent.h>\n" \
"#include <shell_api.h>\n" \
"#include <ksys.h>\n\n" \
"ksys_coff_etable_t EXPORTS[] = {\n");
// Generate
char symbol[256];
while(fscanf(input, "%s", symbol) != EOF) {
strcat(buf, "\t{");
strcat(buf, symbol);
strcat(buf, ", \"");
strcat(buf, symbol);
strcat(buf, "\"},\n");
char temp[256];
sprintf(temp, "{\"%s\", %s},\n", symbol, symbol);
strcat(buf, temp);
}
strcat(buf, "\t0\n};");
strcat(buf, "NULL,\n};");
fclose(input);
// Output generated

View File

@ -1,5 +1,6 @@
AR = ar -rcs
CLINK = ../linuxtools/clink
MKEXP = ../linuxtools/mkexp
KPACK = kpack
INCLUDE = include
@ -27,7 +28,7 @@ RM = rm -rf
MKDIR_P = mkdir -p
endif
all: $(cfiles) $(asmfiles) $(LIB_DIR) $(LIBC.A)
all: mk_export $(cfiles) $(asmfiles) $(LIB_DIR) $(LIBC.A)
fasm crt/crt0.asm $(LIB_DIR)/crt0.o
$(LIBC.A): $(cfiles) $(asmfiles)
@ -45,11 +46,16 @@ clean:
$(RM) $(cfiles) $(asmfiles)
$(RM) $(LIBNAME)
mk_export:
$(MKEXP) ../loader/symbols.txt exports/exports.c
shared: $(cfiles) $(asmfiles)
$(CLINK) $^
$(KPACK) a.out.obj
mv a.out.obj $(LIBC.OBJ)
test:
make -C ../test -f Makefile.tcc
kex ../test/test

View File

@ -1,130 +0,0 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <sys/dirent.h>
#include <ksys.h>
#include <shell_api.h>
ksys_coff_etable_t EXPORTS[] = {
{"abs", abs},
{"acos", acos},
{"acosh", acosh},
{"asin", asin},
{"asinh", asinh},
{"atan", atan},
{"atan2", atan2},
{"atanh", atanh},
{"atoi", atoi},
{"atol", atol},
{"atoll", atoll},
{"calloc", calloc},
{"ceil", ceil},
{"clearerr", clearerr},
{"closedir", closedir},
{"cos", cos},
{"cosh", cosh},
{"debug_printf", debug_printf},
{"difftime", difftime},
{"div", div},
{"exit", exit},
{"exp", exp},
{"fabs", fabs},
{"fclose", fclose},
{"feof", feof},
{"ferror", ferror},
{"fflush", fflush},
{"fgetc", fgetc},
{"fgetpos", fgetpos},
{"fgets", fgets},
{"floor", floor},
{"fmod", fmod},
{"fopen", fopen},
{"fputc", fputc},
{"fputs", fputs},
{"fread", fread},
{"free", free},
{"freopen", freopen},
{"frexp", frexp},
{"fseek", fseek},
{"fsetpos", fsetpos},
{"ftell", ftell},
{"fwrite", fwrite},
{"getchar", getchar},
{"gets", gets},
{"hypot", hypot},
{"itoa", itoa},
{"labs", labs},
{"ldexp", ldexp},
{"ldiv", ldiv},
{"llabs", llabs},
{"lldiv", lldiv},
{"localtime", localtime},
{"log", log},
{"malloc", malloc},
{"memccpy", memccpy},
{"memchr", memchr},
{"memcmp", memcmp},
{"memcpy", memcpy},
{"memmove", memmove},
{"memset", memset},
{"mktime", mktime},
{"modf", modf},
{"modfl", modfl},
{"opendir", opendir},
{"perror", perror},
{"pow", pow},
{"pow10", pow10},
{"pow2", pow2},
{"printf", printf},
{"puts", puts},
{"readdir", readdir},
{"realloc", realloc},
{"remove", remove},
{"rename", rename},
{"rewind", rewind},
{"rewinddir", rewinddir},
{"seekdir", seekdir},
{"shell_printf", shell_printf},
{"shell_puts", shell_puts},
{"shell_putc", shell_putc},
{"shell_getc", shell_getc},
{"shell_gets", shell_gets},
{"shell_cls", shell_cls},
{"shell_exit", shell_exit},
{"setbuf", setbuf},
{"setvbuf", setvbuf},
{"sin", sin},
{"sinh", sinh},
{"snprintf", snprintf},
{"sprintf", sprintf},
{"sqrt", sqrt},
{"strcat", strcat},
{"strchr", strchr},
{"strcmp", strcmp},
{"strcoll", strcoll},
{"strcpy", strcpy},
{"strcspn", strcspn},
{"strerror", strerror},
{"strlen", strlen},
{"strncat", strncat},
{"strncmp", strncmp},
{"strncpy", strncpy},
{"strpbrk", strpbrk},
{"strrchr", strrchr},
{"strrev", strrev},
{"strspn", strspn},
{"strstr", strstr},
{"strtok", strtok},
{"strxfrm", strxfrm},
{"tan", tan},
{"tanh", tanh},
{"telldir", telldir},
{"time", time},
{"tmpfile", tmpfile},
{"tmpnam", tmpnam},
{"vprintf", vprintf},
{"vsnprintf", vsnprintf},
0
};