Skip to content

Instantly share code, notes, and snippets.

@gyuque
Created March 19, 2012 16:46
Show Gist options
  • Save gyuque/2118791 to your computer and use it in GitHub Desktop.
Save gyuque/2118791 to your computer and use it in GitHub Desktop.
CC = clang
OBJS = acyclic.bc aspect.bc class1.bc class2.bc cluster.bc compound.bc conc.bc decomp.bc dotinit.bc dotsplines.bc fastgr.bc flat.bc \
mincross.bc position.bc rank.bc sameport.bc test-dot.bc
LIBS = -L ../common -lcommonll -L../graph -lgraphll -L../cdt -lcdtll -L../gvc -lgvcll -lm -L../pathplan -lpathplanll
INCLUDES = -I. -I.. -I../common -I../gvc -I../pathplan -I../cdt -I../graph
.SUFFIXES: .bc
test-dot-x: $(OBJS)
llvm-ld -o test-dot-x $(LIBS) $(OBJS) emapi/em-apis.o
../../../emscripten-co/emscripten.py -s EXPORTED_FUNCTIONS="[\"_finalizeGVContext\",\"_prepareGVContext\",\"_getFirstNode\",\"_getNextNode\",\"_getCurentGraph\",\"_beginGVJob\",\"_testCountNodes\",\"_countEdges\",\"_extractGraph\",\"_runDotLayout\",\"_getNodeName\",\"_getGraphWidth\",\"_getGraphHeight\",\"_getEdgeColor\",\"_extractRanks\",\"_extractEdgesEarly\",\"_getEdgeLabel\"]" -s EXPORTED_GLOBALS="[\"_sVizContext\"]" test-dot-x.bc > js/em-graphviz.js
# llvm-ld -native -o test-dot $(LIBS) $(OBJS) emapi/em-apis.o
.c.bc:
$(CC) -Os -m32 -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING -UHAVE_GCC_ASM_FOR_X87 $(INCLUDES) -DHAVE_CONFIG_H -emit-llvm -c -o $@ $<
.PHONY: clean
clean:
rm -f test-dot-x
rm -f *.o
rm -f *.bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment