2012-04-20 11:35:31 +00:00
|
|
|
all:
|
|
|
|
@echo 'targets: test nuke parser clean'
|
2010-11-21 22:04:39 +00:00
|
|
|
|
|
|
|
#
|
2012-04-20 11:35:31 +00:00
|
|
|
# run MarkdownTests-1.0.3 that come with original C sources
|
2010-11-21 22:04:39 +00:00
|
|
|
#
|
2012-04-20 11:35:31 +00:00
|
|
|
test: package cmd orig-c-src
|
|
|
|
cd orig-c-src/MarkdownTest_1.0.3; \
|
|
|
|
./MarkdownTest.pl --script=../../cmd/markdown/markdown --tidy
|
2010-11-21 22:04:39 +00:00
|
|
|
|
|
|
|
cmd: package
|
2012-04-20 11:35:31 +00:00
|
|
|
cd cmd/markdown && go build -v
|
2010-11-21 22:04:39 +00:00
|
|
|
|
2012-04-20 11:35:31 +00:00
|
|
|
package: parser.leg.go
|
|
|
|
go install -v
|
2010-11-21 22:04:39 +00:00
|
|
|
|
2012-04-20 11:35:31 +00:00
|
|
|
clean:
|
|
|
|
go clean . ./...
|
2010-11-21 22:04:39 +00:00
|
|
|
rm -rf orig-c-src
|
2012-04-20 11:35:31 +00:00
|
|
|
rm -rf ,,prevmd ,,pmd
|
|
|
|
|
|
|
|
parser: parser.leg.go
|
2010-11-21 22:04:39 +00:00
|
|
|
|
2012-04-20 11:35:31 +00:00
|
|
|
nuke:
|
|
|
|
rm -f parser.leg.go
|
2010-11-21 22:04:39 +00:00
|
|
|
|
2010-12-01 18:40:56 +00:00
|
|
|
|
2012-04-20 11:35:31 +00:00
|
|
|
# LEG parser rules
|
2010-11-21 22:04:39 +00:00
|
|
|
#
|
2012-04-20 11:35:31 +00:00
|
|
|
ifeq ($(MAKECMDGOALS),parser)
|
|
|
|
include $(shell go list -f '{{.Dir}}' github.com/knieriem/peg)/Make.inc
|
2010-11-21 22:04:39 +00:00
|
|
|
%.leg.go: %.leg $(LEG)
|
2012-04-23 22:15:47 +00:00
|
|
|
$(LEG) -verbose -switch -O all $< > $@
|
2010-11-21 22:04:39 +00:00
|
|
|
|
2012-04-20 11:35:31 +00:00
|
|
|
endif
|
2010-12-03 22:27:21 +00:00
|
|
|
|
|
|
|
|
2010-11-21 22:04:39 +00:00
|
|
|
#
|
2012-04-20 11:35:31 +00:00
|
|
|
# get access to original C source files
|
2010-11-21 22:04:39 +00:00
|
|
|
#
|
|
|
|
orig-c-src:
|
2012-04-20 11:35:31 +00:00
|
|
|
hg clone git://github.com/jgm/peg-markdown.git $@
|
2010-11-21 22:04:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
include misc/devel.mk
|
|
|
|
|
|
|
|
.PHONY: \
|
2012-04-20 11:35:31 +00:00
|
|
|
all\
|
2010-11-21 22:04:39 +00:00
|
|
|
cmd\
|
2012-04-20 11:35:31 +00:00
|
|
|
nuke\
|
|
|
|
package\
|
|
|
|
parser\
|
|
|
|
test\
|