2020-12-08 00:08:59 +00:00
|
|
|
all: compile fmt build
|
2018-02-06 10:39:42 +00:00
|
|
|
|
2018-02-23 22:17:51 +00:00
|
|
|
fmt:
|
2018-02-19 11:00:58 +00:00
|
|
|
find . -type f -iregex '.*\.go' -exec gofmt -l -s -w '{}' +
|
2018-02-23 22:17:51 +00:00
|
|
|
|
|
|
|
build:
|
2018-07-02 17:48:55 +00:00
|
|
|
go generate ./...
|
2020-05-13 18:05:15 +00:00
|
|
|
go build ./cmd/...
|
2017-11-07 06:21:38 +00:00
|
|
|
|
2018-02-06 17:11:47 +00:00
|
|
|
test:
|
2021-07-31 17:01:44 +00:00
|
|
|
go test -v ./...
|
2018-04-09 20:26:44 +00:00
|
|
|
|
|
|
|
cover:
|
2018-01-12 23:59:24 +00:00
|
|
|
go test ./... --cover
|
2017-12-04 10:40:36 +00:00
|
|
|
|
2018-02-18 12:25:20 +00:00
|
|
|
bench:
|
2023-03-25 14:29:51 +00:00
|
|
|
go test -benchmem -bench=. ./internal/php8
|
2020-05-18 19:36:39 +00:00
|
|
|
go test -benchmem -bench=. ./internal/php7
|
2018-02-18 12:25:20 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
compile: ./internal/php8/php8.go ./internal/php7/php7.go ./internal/php8/scanner.go ./internal/php7/scanner.go
|
2021-07-30 17:53:27 +00:00
|
|
|
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php8/php8.go
|
2023-03-25 14:29:51 +00:00
|
|
|
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go
|
2021-07-30 17:53:27 +00:00
|
|
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/php8.go
|
2023-03-25 14:29:51 +00:00
|
|
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php7/php7.go
|
2021-07-30 17:53:27 +00:00
|
|
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/scanner.go
|
2023-03-25 14:29:51 +00:00
|
|
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php7/scanner.go
|
2018-02-06 10:39:42 +00:00
|
|
|
rm -f y.output
|
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
./internal/php8/php8.go: ./internal/php8/php8.y
|
|
|
|
goyacc -o $@ $<
|
|
|
|
|
|
|
|
./internal/php8/scanner.go: ./internal/php8/scanner.rl
|
2019-03-10 21:37:01 +00:00
|
|
|
ragel -Z -G2 -o $@ $<
|
2017-11-23 15:33:47 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
./internal/php7/scanner.go: ./internal/php7/scanner.rl
|
|
|
|
ragel -Z -G2 -o $@ $<
|
2018-01-26 13:24:56 +00:00
|
|
|
|
2020-05-12 21:16:36 +00:00
|
|
|
./internal/php7/php7.go: ./internal/php7/php7.y
|
2017-11-23 15:33:47 +00:00
|
|
|
goyacc -o $@ $<
|
2018-06-04 21:09:21 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
cpu_pprof:
|
|
|
|
go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php8
|
|
|
|
go tool pprof ./php8.test cpu.pprof
|
2021-07-30 17:53:27 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
mem_pprof:
|
|
|
|
go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php8
|
|
|
|
go tool pprof -alloc_objects ./php8.test mem.pprof
|
2021-07-30 17:53:27 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
cpu_pprof_php7:
|
2020-05-18 19:36:39 +00:00
|
|
|
go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php7
|
2018-06-21 17:37:34 +00:00
|
|
|
go tool pprof ./php7.test cpu.pprof
|
2018-06-04 21:09:21 +00:00
|
|
|
|
2023-03-25 14:29:51 +00:00
|
|
|
mem_pprof_php5:
|
2020-05-18 19:36:39 +00:00
|
|
|
go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php7
|
2018-06-21 17:37:34 +00:00
|
|
|
go tool pprof -alloc_objects ./php7.test mem.pprof
|