summaryrefslogtreecommitdiff
path: root/Makefile
blob: 3d39edc3568ad31f969a661a7b65174cc8f5d901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.PHONY: test
GITHUB_ORG_URI := https://github.com/yaml
TEST_SUITE_URL := $(GITHUB_ORG_URI)/yaml-test-suite
LIBYAML_DIR ?= $(PWD)/libyaml-parser-emitter/libyaml

default: help

help:
	@echo 'test  - Run the tests'
	@echo 'clean - Remove generated files'
	@echo 'help  - Show help'

# Depends on parser and emitter but, building parser will also build emitter.
# Building twice makes things fail. Note: Some environments like on OS X, the
# shell resets the {DY,}LD_LIBRARY_PATH vars, so we work around it like so:
test: data src/libyaml-parser
	(export MY_LD_LIBRARY_PATH=$(LIBYAML_DIR)/src/.libs; prove -lv test)

clean:
	rm -fr data

data:
	git clone $(TEST_SUITE_URL) $@ --branch=$@

%/libyaml-parser %/libyaml-emitter: %
	(cd $<; make clean build)
	(cd $<; make clean build)

libyaml-parser-emitter:
	git clone $(GITHUB_ORG_URI)/$@ $@