php-parser/Makefile

35 lines
527 B
Makefile
Raw Normal View History

PHPFILE=example.php
2017-11-07 08:21:38 +02:00
2018-02-24 00:17:51 +02:00
all: compile fmt build run
2018-02-06 12:39:42 +02:00
2018-02-24 00:17:51 +02:00
fmt:
find . -type f -iregex '.*\.go' -exec gofmt -l -s -w '{}' +
2018-02-24 00:17:51 +02:00
build:
2017-11-07 08:21:38 +02:00
go build
2018-02-24 00:17:51 +02:00
run:
./php-parser $(PHPFILE)
2017-11-07 08:21:38 +02:00
2018-02-06 19:11:47 +02:00
test:
2018-04-09 23:26:44 +03:00
go test ./...
cover:
2018-01-13 01:59:24 +02:00
go test ./... --cover
2017-12-04 12:40:36 +02:00
2018-02-18 14:25:20 +02:00
bench:
go test -benchmem -bench=. ./php5
go test -benchmem -bench=. ./php7
2018-02-06 12:39:42 +02:00
compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go
rm -f y.output
2018-01-24 18:42:23 +02:00
./scanner/scanner.go: ./scanner/scanner.l
2017-11-23 17:33:47 +02:00
golex -o $@ $<
2018-01-26 15:24:56 +02:00
./php5/php5.go: ./php5/php5.y
goyacc -o $@ $<
./php7/php7.go: ./php7/php7.y
2017-11-23 17:33:47 +02:00
goyacc -o $@ $<