mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03: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
|
HEADER_FILE=libenry.h
|
||||||
NATIVE_LIB=./shared/enry.go
|
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):
|
$(LINGUIST_PATH):
|
||||||
git clone https://github.com/github/linguist.git $@
|
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 && \
|
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
|
benchmarks/linguist-samples.rb 5 >benchmarks/output/linguist_samples.bench
|
||||||
|
|
||||||
onigumura:
|
$(RUBEX_ORIG): %.orig : %
|
||||||
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' $<
|
||||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' internal/tokenizer/tokenize.go
|
@touch $@
|
||||||
sed -i.orig -e 's/"regexp"/regexp "github.com\/moovweb\/rubex"/g' common.go
|
|
||||||
|
onigumura: $(RUBEX_ORIG)
|
||||||
|
|
||||||
revert-onigumura:
|
revert-onigumura:
|
||||||
mv internal/code-generator/generator/heuristics.go.orig internal/code-generator/generator/heuristics.go
|
@for file in $(RUBEX_PATCHED); do if [ -e "$$file.orig" ]; then mv "$$file.orig" "$$file" && echo mv "$$file.orig" "$$file"; fi; done
|
||||||
mv internal/tokenizer/tokenize.go.orig internal/tokenizer/tokenize.go
|
|
||||||
mv common.go.orig common.go
|
|
||||||
|
|
||||||
build-cli:
|
build-cli:
|
||||||
go build -o enry -ldflags "$(LOCAL_LDFLAGS)" cli/enry/main.go
|
go build -o enry -ldflags "$(LOCAL_LDFLAGS)" cli/enry/main.go
|
||||||
|
Loading…
x
Reference in New Issue
Block a user