aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-06 03:52:48 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-18 11:25:42 +0900
commit776ca3085c44e6570813270df75278849c37d400 (patch)
tree6dc3f2d468cfd860347f2f9d519f49c2a38d4c64 /Makefile
parenta3caa8166baeb348f817eb1b4fa2e81672b3d77f (diff)
downloadkati-776ca3085c44e6570813270df75278849c37d400.tar.gz
[C++] The first commit for C++ version
16 tests out of 169 are passing.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 41 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 68007db..57e82c5 100644
--- a/Makefile
+++ b/Makefile
@@ -12,24 +12,59 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-GOSRC = $(wildcard *.go)
+GO_SRCS:=$(wildcard *.go)
+CXX_SRCS:= \
+ ast.cc \
+ dep.cc \
+ eval.cc \
+ exec.cc \
+ file.cc \
+ file_cache.cc \
+ fileutil.cc \
+ func.cc \
+ main.cc \
+ parser.cc \
+ rule.cc \
+ string_piece.cc \
+ string_pool.cc \
+ stringprintf.cc \
+ strutil.cc \
+ value.cc \
+ var.cc
+CXX_TEST_SRCS:= \
+ $(wildcard *_test.cc)
+CXX_OBJS:=$(CXX_SRCS:.cc=.o)
+CXX_TEST_OBJS:=$(CXX_TEST_SRCS:.cc=.o)
+CXX_ALL_OBJS:=$(CXX_SRCS:.cc=.o) $(CXX_TEST_SRCS:.cc=.o)
+CXX_TEST_EXES:=$(CXX_TEST_OBJS:.o=)
+CXXFLAGS:=-g -W -Wall -MMD # -O
-all: kati go_test para
+all: kati para ckati $(CXX_TEST_EXES)
-kati: $(GOSRC)
+kati: $(GO_SRCS)
env $(shell go env) go build -o $@ *.go
-go_test: $(GOSRC) para
+ckati: $(CXX_OBJS)
+ $(CXX) -std=c++11 $(CXXFLAGS) -o $@ $(CXX_OBJS)
+
+$(CXX_ALL_OBJS): %.o: %.cc
+ $(CXX) -c -std=c++11 $(CXXFLAGS) -o $@ $<
+
+$(CXX_TEST_EXES): $(filter-out main.o,$(CXX_OBJS))
+$(CXX_TEST_EXES): %: %.o
+ $(CXX) $^ -o $@
+
+go_test: $(GO_SRCS) para
env $(shell go env) go test *.go
para: para.cc
$(CXX) -std=c++11 -g -O -W -Wall -MMD -o $@ $<
-test: all
+test: all go_test
ruby runtest.rb
clean:
- rm -rf out kati
+ rm -rf out kati ckati *.o *.d
.PHONY: test