diff options
author | Patrick Simianer <p@simianer.de> | 2015-03-23 11:03:25 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-03-23 11:03:25 +0100 |
commit | 775a1055d2ad4e05c007440c467a3f5345bfb0e7 (patch) | |
tree | b22fe78a5614821678230d3b9889373166e20735 | |
parent | f2989ef661bdb73eabee174ba5c956e2aba5540c (diff) |
pretty makefile
-rw-r--r-- | Makefile | 99 |
1 files changed, 73 insertions, 26 deletions
@@ -1,24 +1,36 @@ COMPILER=clang CFLAGS=-std=c++11 -O3 -Wall - -TCMALLOC=$(shell pwd)/external/gperftools-2.1/lib/libtcmalloc_minimal.a -pthread -MSGPACK_C=$(shell pwd)/external/msgpack-c/lib/libmsgpack.a -I./external/msgpack-c/include -JSON_CPP=-I$(shell pwd)/external/json-cpp/include +TCMALLOC=external/gperftools/lib/libtcmalloc_minimal.a -pthread +MSGPACK_C_INCLUDE=-I external/msgpack-c/include +MSGPACK_C=external/msgpack-c/lib/libmsgpack.a $(MSGPACK_C_INCLUDE) +JSON_CPP_INCLUDE=-I external/json-cpp/include SRC=src BIN=bin -################################################################################ -# fast_weaver -PRINT = @echo -e "\e[1;34mBuilding $@\e[0m" +PRINT_BEGIN = @echo -e "\e[1;31mBuilding $@ ...\e[0m" +PRINT_END = @echo -e "\e[1;32mfinished building $@\e[0m" +############################################################################### +# all +# all: $(BIN)/fast_weaver util test +############################################################################### +# fast_weaver +# + $(BIN)/fast_weaver: $(BIN) $(SRC)/hypergraph.o $(SRC)/fast_weaver.cc - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(MSGPACK_C) $(TCMALLOC) $(SRC)/hypergraph.o \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(MSGPACK_C) \ + $(TCMALLOC) \ + $(SRC)/hypergraph.o \ $(SRC)/fast_weaver.cc \ -o $(BIN)/fast_weaver + $(PRINT_END) $(BIN): mkdir -p $(BIN) @@ -27,59 +39,94 @@ $(SRC)/hypergraph.o: $(SRC)/hypergraph.cc $(SRC)/hypergraph.hh \ $(SRC)/grammar.hh \ $(SRC)/semiring.hh $(SRC)/sparse_vector.hh \ $(SRC)/types.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -g -c $(TCMALLOC) $(MSGPACK_C) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -g \ + -c \ + $(MSGPACK_C_INCLUDE) \ $(SRC)/hypergraph.cc \ -o $(SRC)/hypergraph.o + $(PRINT_END) -################################################################################ +############################################################################### # util +# util: $(BIN)/make_pak $(BIN)/read_pak $(BIN)/make_pak: $(BIN) $(SRC)/make_pak.cc external/json-cpp/single_include/json-cpp.hpp \ $(SRC)/hypergraph.hh $(SRC)/types.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(MSGPACK_C) $(JSON_CPP) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(MSGPACK_C) \ + $(JSON_CPP_INCLUDE) \ $(SRC)/make_pak.cc \ -o $(BIN)/make_pak + $(PRINT_END) $(BIN)/read_pak: $(SRC)/read_pak.cc - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ $(MSGPACK_C) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + $(MSGPACK_C) \ $(SRC)/read_pak.cc \ -o $(BIN)/read_pak + $(PRINT_END) -################################################################################ +############################################################################### # test +# test: $(BIN)/test_grammar $(BIN)/test_hypergraph $(BIN)/test_parse $(BIN)/test_sparse_vector $(BIN)/test_grammar: $(BIN) $(SRC)/test_grammar.cc $(SRC)/grammar.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) $(MSGPACK_C) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(TCMALLOC) \ + $(MSGPACK_C) \ $(SRC)/test_grammar.cc \ -o $(BIN)/test_grammar + $(PRINT_END) $(BIN)/test_hypergraph: $(BIN) $(SRC)/test_hypergraph.cc $(SRC)/hypergraph.o $(SRC)/grammar.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) $(MSGPACK_C) $(SRC)/hypergraph.o \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(TCMALLOC) \ + $(MSGPACK_C) \ + $(SRC)/hypergraph.o \ $(SRC)/test_hypergraph.cc \ -o $(BIN)/test_hypergraph + $(PRINT_END) $(BIN)/test_parse: $(BIN) $(SRC)/test_parse.cc $(SRC)/parse.hh \ $(SRC)/grammar.hh $(SRC)/util.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) $(MSGPACK_C) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(TCMALLOC) \ + $(MSGPACK_C) \ $(SRC)/test_parse.cc \ -o $(BIN)/test_parse + $(PRINT_END) $(BIN)/test_sparse_vector: $(BIN) $(SRC)/test_sparse_vector.cc $(SRC)/sparse_vector.hh - $(PRINT) - $(COMPILER) $(CFLAGS) -lstdc++ -lm $(TCMALLOC) \ + $(PRINT_BEGIN) + $(COMPILER) $(CFLAGS) \ + -lstdc++ \ + -lm \ + $(TCMALLOC) \ $(SRC)/test_sparse_vector.cc \ -o $(BIN)/test_sparse_vector + $(PRINT_END) -################################################################################ +############################################################################### # clean +# clean: rm -f $(SRC)/*.o rm -f $(BIN)/* |