markdown/Makefile

80 lines
1.1 KiB
Makefile
Raw Normal View History

2010-11-21 22:04:39 +00:00
include $(GOROOT)/src/Make.inc
2010-12-01 18:40:56 +00:00
TARG=github.com/knieriem/markdown
2010-11-21 22:04:39 +00:00
GOFILES=\
markdown.go\
output.go\
parser.leg.go\
package:
include $(GOROOT)/src/Make.pkg
all: cmd
#
# mdtest runs MarkdownTests-1.0.3 that come with original C sources
#
mdtest: package cmd orig-c-src
make -C cmd test
cmd: package
make -C cmd
CLEANFILES=\
parser.leg.go\
_obj\
,,c\
,,fmt\
distclean: clean clean-sub
rm -rf orig-c-src
clean-sub:
for dir in cmd peg peg/leg; do make -C $$dir clean; done
2010-12-01 18:40:56 +00:00
VCS = git
GITHUB = git://github.com
# also, if hggit extension is available:
# VCS = hg
2010-12-03 22:27:21 +00:00
VCS-PULLFLAGS =
2010-12-01 18:40:56 +00:00
2010-11-21 22:04:39 +00:00
#
# LEG parser generator stuff
#
LEG = ./peg/leg/leg
%.leg.go: %.leg $(LEG)
2011-06-29 18:04:44 +00:00
$(LEG) -switch $<
2010-11-21 22:04:39 +00:00
$(LEG):
if(! test -d peg); then make peg; fi
make -C peg all GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH)
make -C peg/leg all GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH)
2010-11-21 22:04:39 +00:00
peg:
2010-12-01 18:40:56 +00:00
$(VCS) clone $(GITHUB)/knieriem/peg
2010-11-21 22:04:39 +00:00
2010-12-03 22:27:21 +00:00
update-peg:
cd peg && $(VCS) pull $(VCS-PULLFLAGS)
cd peg/leg && make clean
2010-11-21 22:04:39 +00:00
#
# access to original C source files
#
orig-c-src:
2010-12-01 18:40:56 +00:00
$(VCS) clone $(GITHUB)/jgm/peg-markdown.git $@
2010-11-21 22:04:39 +00:00
include misc/devel.mk
.PHONY: \
cmd\
distclean\
mdtest\