diff --git a/README.org b/README.org index 8a311da..2d02a0c 100644 --- a/README.org +++ b/README.org @@ -1,5 +1,29 @@ * c.thi.ng +* Contents :toc_3_gh: + - [[#cthing][c.thi.ng]] + - [[#overview][Overview]] + - [[#data-structures][Data structures]] + - [[#memory-management][Memory management]] + - [[#math][Math]] + - [[#simulation][Simulation]] + - [[#geometry][Geometry]] + - [[#examples][Examples]] + - [[#1d2d-cellular-automata][1D/2D Cellular automata]] + - [[#diffusion-limited-aggregation][Diffusion-Limited Aggregation]] + - [[#poisson-disc-sampling-image-conversion][Poisson disc sampling image conversion]] + - [[#verlet-physics][Verlet physics]] + - [[#requirements][Requirements]] + - [[#dependencies][Dependencies]] + - [[#build--test][Build & test]] + - [[#build-static-library][Build static library]] + - [[#build-source-x-ref][Build source x-ref]] + - [[#disassemble--list-symbols][Disassemble & list symbols]] + - [[#compile-with-emscripten][Compile with emscripten]] + - [[#build-customization][Build customization]] + - [[#contributors][Contributors]] + - [[#license][License]] + ** Overview WIP @@ -200,16 +224,26 @@ nm -g -j bin/release/libcthing.a | grep --color=never _ct_ ** Compile with emscripten #+BEGIN_SRC shell -# help / usage -./compile -h - -# compile with tests, closure pass & remove duplicate fns -./compile -tdc - -python3 -m http.server - -# in browser dev console - http://localhost:8000/ -# geom(); geom._main() + # help / usage + ./compile -h + # Usage: + # -a : separate asm.js output + # -c : enable Closure compiler step + # -d : remove duplicate functions + # -D SYM : add define + # -h : show this help + # -k : enable runtime checks + # -m : enable memory checks + # -s : enable SSE (SIMD.js) + # -t : include tests + + # compile with tests, closure pass & remove duplicate fns + ./compile -tdc + + python3 -m http.server + + # in browser dev console - http://localhost:8000/ + cthing(); cthing._main() #+END_SRC ** Build customization diff --git a/compile b/compile index 0c92675..35d57e6 100755 --- a/compile +++ b/compile @@ -7,8 +7,8 @@ SRC="src/data/adjacency.c src/data/cons.c src/data/consrc.c src/data/hashset.c s TESTS= CFLAGS="-std=c11 -Os -Isrc" EMFLAGS="-s ASM_JS=1 -s ASSERTIONS=0 -s INVOKE_RUN=0 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s MODULARIZE=1 -s NO_EXIT_RUNTIME=1 -s TOTAL_MEMORY='48*1024*1024'" -OUT=geom.js -MIN=geom.min.js +OUT=cthing.js +MIN=cthing.min.js usage() { @@ -70,7 +70,7 @@ time emcc $CFLAGS \ --emit-symbol-map \ $EMFLAGS \ -s "TOTAL_STACK=1*1024*1024" \ - -s "EXPORT_NAME='geom'" \ + -s "EXPORT_NAME='cthing'" \ -o $OUT \ $SRC \ $TESTS diff --git a/index.html b/index.html index 3211602..b628ce4 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,8 @@ - + diff --git a/postprocess.js b/postprocess.js index 260ac26..c45d0f1 100644 --- a/postprocess.js +++ b/postprocess.js @@ -1,6 +1,6 @@ fs=require('fs'); -src=fs.readFileSync('geom.js','utf8'); +src=fs.readFileSync('cthing.js','utf8'); src=src.replace(/_ct_\w+_\d+:[\w\$]+,?/g, ''); src=src.replace(/\w+\._ct_\w+_\d+\=\w+._ct_\w+_\d+;/g, ''); src=src.replace(/\s{2,}/g,' '); -fs.writeFileSync('geom.min.js', src, 'utf8'); +fs.writeFileSync('cthing.min.js', src, 'utf8');