Permalink
Browse files

rename emcc artefact, update readme (add TOC)

  • Loading branch information...
postspectacular committed Jun 20, 2016
1 parent bfc7603 commit 867fe847d7392f5978c4f1869a0a8a9486a124d7
Showing with 51 additions and 17 deletions.
  1. +44 −10 README.org
  2. +3 −3 compile
  3. +2 −2 index.html
  4. +2 −2 postprocess.js
View
@@ -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
View
@@ -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
View
@@ -10,8 +10,8 @@
</div>
<!--
<script>var Module = Module || {};</script>
<script src="geom.asm.js" type="text/javascript"></script>
<script src="cthing.asm.js" type="text/javascript"></script>
-->
<script src="geom.min.js" type="text/javascript"></script>
<script src="cthing.min.js" type="text/javascript"></script>
</body>
</html>
View
@@ -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');

0 comments on commit 867fe84

Please sign in to comment.