diff --git a/.gitignore b/.gitignore index d1705523..dc9186f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ .idea + +gyp-mac-tool +Makefile +*.Makefile +*.target.mk +*.xcodeproj + spec/run.out* -*.xcodeproj -*.xcodeproj +out diff --git a/.gitmodules b/.gitmodules index 929aabcc..95ab747b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "externals/bandit"] path = externals/bandit url = https://github.com/joakimkarlsson/bandit.git +[submodule "externals/gyp"] + path = externals/gyp + url = https://github.com/svn2github/gyp.git diff --git a/.travis.yml b/.travis.yml index 51049ea1..d8fb4873 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: cpp compiler: - clang -script: make test \ No newline at end of file +install: script/bootstrap.sh +script: script/ci.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index 0b47f4b2..00000000 --- a/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -.PHONY: all clean test debug valgrind - -### install configuration ### -CXX ?= clang++ -CC ?= clang -RM ?= rm -f - -### library configuration ### -LIB_NAME = tree_sitter -DIR = $(shell pwd) -SOURCES = $(shell find src -name '*.cpp' -or -name '*.c') -TESTS = $(shell find spec -name '*.cpp') $(shell find examples -name '*.c') -SRC_OBJECTS = $(foreach file, $(SOURCES), $(basename $(file)).o) -TEST_OBJECTS = $(foreach file, $(TESTS), $(basename $(file)).o) -LIB_FILE = lib$(LIB_NAME).a -TEST_BIN = spec/run.out - -### build configuration ### -CFLAGS ?= -Wall -g -m64 -CPPFLAGS ?= -Wall -std=c++11 -g -m64 - -### targets ### -all: $(LIB_FILE) - -$(LIB_FILE): $(SRC_OBJECTS) - ar rcs $@ $^ - -test: $(TEST_BIN) - ./$< - -$(TEST_BIN): $(TEST_OBJECTS) $(LIB_FILE) - $(CXX) $(CPPFLAGS) $^ -o $@ - -%.o: %.c - $(CC) $(CFLAGS) -Iinclude -Isrc/runtime -c $< -o $@ - -%.o: %.cpp - $(CXX) $(CPPFLAGS) -Iinclude -Isrc/compiler -Isrc/runtime -Iexternals/bandit -Ispec -c $< -o $@ - -debug: $(TEST_BIN) - gdb $< - -valgrind: $(TEST_BIN) - valgrind --track-origins=yes --dsymutil=yes $(TEST_BIN) - -clean: - $(RM) $(SRC_OBJECTS) $(TEST_OBJECTS) $(LIB_FILE) $(TEST_BIN) diff --git a/externals/gyp b/externals/gyp new file mode 160000 index 00000000..d277a083 --- /dev/null +++ b/externals/gyp @@ -0,0 +1 @@ +Subproject commit d277a083a05f5683a073ddd4991f5f79741b3f93 diff --git a/script/bootstrap.sh b/script/bootstrap.sh new file mode 100755 index 00000000..ab594bfe --- /dev/null +++ b/script/bootstrap.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +git submodule update --init +externals/gyp/gyp tree_sitter.gyp --depth . +externals/gyp/gyp tree_sitter.gyp --depth . --format=make diff --git a/script/ci.sh b/script/ci.sh new file mode 100755 index 00000000..48231928 --- /dev/null +++ b/script/ci.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +make compiler_specs +out/Default/compiler_specs + +make runtime_specs +out/Default/runtime_specs diff --git a/tree_sitter.gyp b/tree_sitter.gyp index f77b4476..0feea7db 100644 --- a/tree_sitter.gyp +++ b/tree_sitter.gyp @@ -20,6 +20,7 @@ 'include', 'externals/bandit', 'src/compiler', + 'spec', ], 'sources': [ '