mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-13 23:12:24 +00:00
Improve the Makefile
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
This commit is contained in:
parent
db0e1e0d71
commit
8eb17ebd11
19
Makefile
19
Makefile
@ -38,6 +38,12 @@ DARWIN_SHARED_LIB=$(DARWIN_DIR)/libenry.dylib
|
||||
HEADER_FILE=libenry.h
|
||||
NATIVE_LIB=./shared/enry.go
|
||||
|
||||
# source files to be patched for using "rubex" instead of "regexp"
|
||||
RUBEX_PATCHED := internal/code-generator/generator/heuristics.go internal/tokenizer/tokenize.go common.go
|
||||
RUBEX_ORIG := $(RUBEX_PATCHED:=.orig)
|
||||
|
||||
.PHONY: revert-onigumura
|
||||
|
||||
$(LINGUIST_PATH):
|
||||
git clone https://github.com/github/linguist.git $@
|
||||
|
||||
@ -63,15 +69,14 @@ benchmarks-slow: $(LINGUST_PATH)
|
||||
mkdir -p benchmarks/output && go test -run=NONE -bench=. -slow -benchtime=100ms -timeout=100h >benchmarks/output/enry_samples.bench && \
|
||||
benchmarks/linguist-samples.rb 5 >benchmarks/output/linguist_samples.bench
|
||||
|
||||
onigumura:
|
||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' internal/code-generator/generator/heuristics.go
|
||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' internal/tokenizer/tokenize.go
|
||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' common.go
|
||||
$(RUBEX_ORIG): %.orig : %
|
||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' $<
|
||||
@touch $@
|
||||
|
||||
onigumura: $(RUBEX_ORIG)
|
||||
|
||||
revert-onigumura:
|
||||
mv internal/code-generator/generator/heuristics.go.orig internal/code-generator/generator/heuristics.go
|
||||
mv internal/tokenizer/tokenize.go.orig internal/tokenizer/tokenize.go
|
||||
mv common.go.orig common.go
|
||||
@for file in $(RUBEX_PATCHED); do if [ -e "$$file.orig" ]; then mv "$$file.orig" "$$file" && echo mv "$$file.orig" "$$file"; fi; done
|
||||
|
||||
build-cli:
|
||||
go build -o enry -ldflags "$(LOCAL_LDFLAGS)" cli/enry/main.go
|
||||
|
Loading…
Reference in New Issue
Block a user