summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-09-16 10:23:14 +0100
committerPatrick Simianer <p@simianer.de>2014-09-16 10:23:14 +0100
commit129a22cfcc7651daa4b11ed52e7870249f6373a5 (patch)
tree78de4649396ab0d37a325b7598f9873c2d65f4c9 /Makefile
parentdf70006a07fb67b17fb39aa56762c50c2e7b8131 (diff)
spring cleaning
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 52 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f499591..56f89d4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,53 @@
-json_examples:
- ./main.rb -w example/3/weights.init < example/3/in.sgm > example/3/3.json 2>/dev/null
- ./main.rb -w example/3/weights.init -l < example/3/in.sgm > example/3/3-with-glue.json 2>/dev/null
- ./main.rb -w example/glue/weights -l < example/glue/in.sgm > example/glue/glue.json 2>/dev/null
- ./main.rb -w example/toy/weights < example/toy/in.sgm > example/toy/toy.json 2>/dev/null
- ./main.rb -w example/toy/weights < example/toy/in-test.sgm > example/toy/toy-test.json 2>/dev/null
+COMPILER=clang
+CFLAGS=-std=c++11 -O3 -Wall
+TCMALLOC=$(shell pwd)/external/gperftools-2.1/lib/libtcmalloc_minimal.a -pthread
+SRC=src
+
+all: $(SRC)/hypergraph.o $(SRC)/fast_weaver.cc
+ $(COMPILER) $(CFLAGS) -lstdc++ -lm -lmsgpack $(TCMALLOC) $(SRC)/hypergraph.o \
+ $(SRC)/fast_weaver.cc \
+ -o fast_weaver
+
+$(SRC)/hypergraph.o: $(SRC)/hypergraph.cc $(SRC)/hypergraph.hh \
+ $(SRC)/semiring.hh $(SRC)/sparse_vector.hh \
+ $(SRC)/types.hh
+ $(COMPILER) $(CFLAGS) -g -c $(TCMALLOC) \
+ $(SRC)/hypergraph.cc \
+ -o $(SRC)/hypergraph.o
+
+util: make_pak read_pak
+
+make_pak: $(SRC)/make_pak.cc external/json-cpp/single_include/json-cpp.hpp \
+ $(SRC)/hypergraph.hh $(SRC)/types.hh
+ $(COMPILER) $(CFLAGS) -lstdc++ -lm -lmsgpack -I./external \
+ $(SRC)/make_pak.cc \
+ -o make_pak
+
+read_pak: $(SRC)/read_pak.cc
+ $(COMPILER) $(CFLAGS) -lstdc++ -lmsgpack \
+ $(SRC)/read_pak.cc \
+ -o read_pak
+
+test: test_grammar test_parse test_sparse_vector
+
+test_grammar: $(SRC)/test_grammar.cc $(SRC)/grammar.hh
+ $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) \
+ $(SRC)/test_grammar.cc \
+ -o test_grammar
+
+test_parse: $(SRC)/test_parse.cc $(SRC)/parse.hh \
+ $(SRC)/grammar.hh $(SRC)/util.hh
+ $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) \
+ $(SRC)/test_parse.cc \
+ -o test_parse
+
+test_sparse_vector: $(SRC)/test_sparse_vector.cc $(SRC)/sparse_vector.hh
+ $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) \
+ $(SRC)/test_sparse_vector.cc \
+ -o test_sparse_vector
+
+clean:
+ rm -f fast_weaver hypergraph.o
+ rm -f make_pak read_pak
+ rm -f test_grammar test_sparse_vector test_parse