Skip to content

Commit

Permalink
ウェブ版をアーカイブ対応にする
Browse files Browse the repository at this point in the history
```
  3036 default.css
  3474 index.html
128421 main.js
185195 wasi_worker.js
125219 wccfiles.zip
```
  • Loading branch information
tyfkda committed Feb 28, 2024
1 parent a8d1360 commit d4d6885
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 229 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ core

### wasm

libsrc/_wasm/crt0.c
libsrc/_wasm/libc.c
# libsrc/_wasm/crt0.c
# libsrc/_wasm/libc.c

*.wasm
/wcc
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ ASSETS_DIR:=public
.PHONY: assets
assets: $(ASSETS_DIR)/wccfiles.zip

$(WCC_DIR)/www/lib_list.json: $(LIBSRC_DIR)/_wasm/crt0.c $(LIBSRC_DIR)/_wasm/libc.c
npx ts-node tool/update_lib_list.ts --base=./libsrc $^

$(ASSETS_DIR)/wccfiles.zip: $(WCC_DIR)/www/lib_list.json cc.wasm
$(ASSETS_DIR)/wccfiles.zip: $(WCC_DIR)/www/lib_list.json cc.wasm $(WCC_LIB_DIR)/wcrt0.a $(WCC_LIB_DIR)/wlibc.a
@mkdir -p $(ASSETS_DIR)
npx ts-node tool/pack_libs.js $(WCC_DIR)/www/lib_list.json $@

Expand Down
162 changes: 2 additions & 160 deletions src/wcc/www/lib_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,166 +32,8 @@
"wasi.h": "./libsrc/_wasm/wasi.h"
},
"lib": {
"_file.h": "./libsrc/stdio/_file.h",
"_fileman.h": "./libsrc/stdio/_fileman.h",
"_malloc.h": "./libsrc/stdlib/_malloc.h",
"_ieee.h": "./libsrc/math/_ieee.h",
"crt0.c": [
"./libsrc/_wasm/crt0/_start.c"
],
"libc.c": [
"./libsrc/math/_normalize_radian.c",
"./libsrc/math/acos.c",
"./libsrc/math/acosh.c",
"./libsrc/math/asin.c",
"./libsrc/math/asinh.c",
"./libsrc/math/atan.c",
"./libsrc/math/atan2.c",
"./libsrc/math/atanh.c",
"./libsrc/math/ceil.c",
"./libsrc/math/copysign.c",
"./libsrc/math/cos.c",
"./libsrc/math/cosh.c",
"./libsrc/math/exp.c",
"./libsrc/math/fabs.c",
"./libsrc/math/floor.c",
"./libsrc/math/fmod.c",
"./libsrc/math/frexp.c",
"./libsrc/math/isfinite.c",
"./libsrc/math/isinf.c",
"./libsrc/math/isnan.c",
"./libsrc/math/log.c",
"./libsrc/math/log10.c",
"./libsrc/math/modf.c",
"./libsrc/math/pow.c",
"./libsrc/math/round.c",
"./libsrc/math/sin.c",
"./libsrc/math/sinh.c",
"./libsrc/math/sqrt.c",
"./libsrc/math/tan.c",
"./libsrc/math/tanh.c",
"./libsrc/misc/basename.c",
"./libsrc/misc/dirname.c",
"./libsrc/misc/errno.c",
"./libsrc/misc/isalnum.c",
"./libsrc/misc/isalpha.c",
"./libsrc/misc/isdigit.c",
"./libsrc/misc/islower.c",
"./libsrc/misc/isspace.c",
"./libsrc/misc/isupper.c",
"./libsrc/misc/isxdigit.c",
"./libsrc/misc/longjmp.c",
"./libsrc/misc/setjmp.c",
"./libsrc/misc/tolower.c",
"./libsrc/misc/toupper.c",
"./libsrc/stdio/_fclose.c",
"./libsrc/stdio/_fflush.c",
"./libsrc/stdio/_finit.c",
"./libsrc/stdio/_fread.c",
"./libsrc/stdio/_fseek.c",
"./libsrc/stdio/_fwrite.c",
"./libsrc/stdio/assert.c",
"./libsrc/stdio/fclose.c",
"./libsrc/stdio/fdopen.c",
"./libsrc/stdio/feof.c",
"./libsrc/stdio/fflush.c",
"./libsrc/stdio/fgetc.c",
"./libsrc/stdio/fgets.c",
"./libsrc/stdio/fileno.c",
"./libsrc/stdio/fmemopen.c",
"./libsrc/stdio/fopen.c",
"./libsrc/stdio/fprintf.c",
"./libsrc/stdio/fputc.c",
"./libsrc/stdio/fputs.c",
"./libsrc/stdio/fread.c",
"./libsrc/stdio/fseek.c",
"./libsrc/stdio/ftell.c",
"./libsrc/stdio/fwrite.c",
"./libsrc/stdio/getline.c",
"./libsrc/stdio/open_memstream.c",
"./libsrc/stdio/perror.c",
"./libsrc/stdio/printf.c",
"./libsrc/stdio/putchar.c",
"./libsrc/stdio/puts.c",
"./libsrc/stdio/remove.c",
"./libsrc/stdio/snprintf.c",
"./libsrc/stdio/sprintf.c",
"./libsrc/stdio/stdin.c",
"./libsrc/stdio/tmpfile.c",
"./libsrc/stdio/vfprintf.c",
"./libsrc/stdio/vprintf.c",
"./libsrc/stdio/vsnprintf.c",
"./libsrc/stdio/vsprintf.c",
"./libsrc/stdlib/atexit.c",
"./libsrc/stdlib/atof.c",
"./libsrc/stdlib/atoi.c",
"./libsrc/stdlib/atol.c",
"./libsrc/stdlib/atoll.c",
"./libsrc/stdlib/calloc.c",
"./libsrc/stdlib/drand48.c",
"./libsrc/stdlib/erand48.c",
"./libsrc/stdlib/exit.c",
"./libsrc/stdlib/getrandom.c",
"./libsrc/stdlib/lrand48.c",
"./libsrc/stdlib/malloc.c",
"./libsrc/stdlib/mkstemp.c",
"./libsrc/stdlib/mkstemps.c",
"./libsrc/stdlib/nrand48.c",
"./libsrc/stdlib/qsort.c",
"./libsrc/stdlib/rand.c",
"./libsrc/stdlib/realloc.c",
"./libsrc/stdlib/srand.c",
"./libsrc/stdlib/strtod.c",
"./libsrc/stdlib/strtol.c",
"./libsrc/stdlib/strtold.c",
"./libsrc/stdlib/strtoll.c",
"./libsrc/stdlib/strtoul.c",
"./libsrc/stdlib/strtoull.c",
"./libsrc/string/memccpy.c",
"./libsrc/string/memchr.c",
"./libsrc/string/memcmp.c",
"./libsrc/string/memcpy.c",
"./libsrc/string/memmove.c",
"./libsrc/string/memset.c",
"./libsrc/string/stpcpy.c",
"./libsrc/string/stpncpy.c",
"./libsrc/string/strcasecmp.c",
"./libsrc/string/strcat.c",
"./libsrc/string/strchr.c",
"./libsrc/string/strcmp.c",
"./libsrc/string/strcoll.c",
"./libsrc/string/strcpy.c",
"./libsrc/string/strcspn.c",
"./libsrc/string/strdup.c",
"./libsrc/string/strerror.c",
"./libsrc/string/strerror_r.c",
"./libsrc/string/strlen.c",
"./libsrc/string/strncasecmp.c",
"./libsrc/string/strncat.c",
"./libsrc/string/strncmp.c",
"./libsrc/string/strncpy.c",
"./libsrc/string/strndup.c",
"./libsrc/string/strnlen.c",
"./libsrc/string/strpbrk.c",
"./libsrc/string/strrchr.c",
"./libsrc/string/strspn.c",
"./libsrc/string/strstr.c",
"./libsrc/string/strtok.c",
"./libsrc/string/strtok_r.c",
"./libsrc/_wasm/unistd/brk.c",
"./libsrc/_wasm/unistd/clock_gettime.c",
"./libsrc/_wasm/unistd/close.c",
"./libsrc/_wasm/unistd/fstat.c",
"./libsrc/_wasm/unistd/getcwd.c",
"./libsrc/_wasm/unistd/lseek.c",
"./libsrc/_wasm/unistd/lstat.c",
"./libsrc/_wasm/unistd/open.c",
"./libsrc/_wasm/unistd/read.c",
"./libsrc/_wasm/unistd/stat.c",
"./libsrc/_wasm/unistd/time.c",
"./libsrc/_wasm/unistd/unlink.c",
"./libsrc/_wasm/unistd/write.c"
]
"wcrt0.a": "./lib/wcrt0.a",
"wlibc.a": "./lib/wlibc.a"
}
}
}
2 changes: 1 addition & 1 deletion tool/pack_libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fsPromise = require('fs').promises
const {zip} = require('fflate')

function isBinFile(fileName) {
return fileName.match(/\.(wasm)$/) != null
return fileName.match(/\.(wasm|a)$/) != null
}

function replaceRelativeInclude(content) {
Expand Down
3 changes: 1 addition & 2 deletions tool/run-gen2wcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ fi
--dir=. \
--dir=/tmp \
"--mapdir=/usr/include::$PRJROOT/include" \
"--mapdir=/usr/lib::$PRJROOT/libsrc/_wasm" \
"--mapdir=/usr/local/include::$PRJROOT/libsrc" \
"--mapdir=/usr/lib::$PRJROOT/lib" \
"$WCCWASM" -- "$@"
60 changes: 0 additions & 60 deletions tool/update_lib_list.ts

This file was deleted.

0 comments on commit d4d6885

Please sign in to comment.