2017-11-07 06:21:38 +00:00
|
|
|
# Copyright (c) 2011 CZ.NIC z.s.p.o. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
# blame: jnml, labs.nic.cz
|
2018-01-05 11:17:59 +00:00
|
|
|
PHPFILE=example.php
|
2017-11-07 06:21:38 +00:00
|
|
|
|
2017-12-04 10:40:36 +00:00
|
|
|
all: ./parser/parser.go ./parser/scanner.go
|
2017-11-23 15:33:47 +00:00
|
|
|
rm -f y.output
|
|
|
|
gofmt -l -s -w *.go
|
2017-11-07 06:21:38 +00:00
|
|
|
go build
|
|
|
|
|
|
|
|
run: all
|
2018-01-05 11:17:59 +00:00
|
|
|
./php-parser $(PHPFILE)
|
2017-11-07 06:21:38 +00:00
|
|
|
|
2017-12-04 10:40:36 +00:00
|
|
|
test: all
|
|
|
|
go test ./test/...
|
|
|
|
|
|
|
|
./parser/scanner.go: ./parser/scanner.l
|
2017-11-23 15:33:47 +00:00
|
|
|
golex -o $@ $<
|
|
|
|
|
2017-12-04 10:40:36 +00:00
|
|
|
./parser/parser.go: ./parser/parser.y
|
2017-11-23 15:33:47 +00:00
|
|
|
goyacc -o $@ $<
|