php-parser/Makefile

24 lines
479 B
Makefile
Raw Normal View History

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
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
./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 $@ $<