Makefile 2.29 KB
Newer Older
1
all: doc
2

3 4 5
include links.mk

links.mk: links
6
	awk '{ print("LINKS +=", $$1); print($$1, ":"); print("\tmkdir -p $$(shell dirname ", $$1, ")"); print("\tln -sf", $$2, $$1)}' $^ > $@
7

8 9 10
MANPAGES = $(patsubst bin/%, man/%.1, $(shell grep -rl =head1 bin/*))

all: $(LINKS) $(MANPAGES)
11

12 13
.PHONY: spec check test

Antonio Terceiro's avatar
Antonio Terceiro committed
14
checkdeps:
15
	@if which dpkg-checkbuilddeps >/dev/null && which grep-dctrl >/dev/null; then dpkg-checkbuilddeps -d "$$(grep-dctrl -n -s Depends . debian/control | grep -v '\$$')"; fi
Antonio Terceiro's avatar
Antonio Terceiro committed
16

17
spec:
18
	@./test/banner 'Ruby unit tests'
19
	rspec --color
20

Antonio Terceiro's avatar
Antonio Terceiro committed
21
functional-tests:
22
	@./test/banner 'Functional tests'
23
	test/runall.sh
24
	$(RM) -v test/erl_crash.dump
25

26 27 28 29 30 31 32 33
backends = $(shell ls -1 backends/)
test_backends = $(patsubst %, test-%, $(backends))
.PHONY: $(test_backends)

test-backends: $(test_backends)

$(test_backends): test-% : backends/%/test-package
	@./test/banner "Test backend $*"
34 35
	./bin/debci test -b $* test/fake-package/ > log/test-$*.log 2>&1 # local source package
	./bin/debci test -b $* ruby-defaults      > log/test-$*.log 2>&1 # source package from archive
36

37 38
deb:
	mkdir -p tmp/deb
39
	rm -rf tmp/deb/debci*
40
	DEB_BUILD_OPTIONS=nocheck gbp buildpackage --git-ignore-branch --git-export-dir=tmp/deb
41
	cd tmp/deb && dpkg-scanpackages . > Packages
42 43 44
	@echo
	@echo "Debian packages available in tmp/deb/!"

45 46 47
ruby-console:
	irb -Ilib -rdebci

48 49 50 51 52 53 54
check: all check-ui-and-docs spec functional-tests

check-ui-and-docs: all
	test -d public/doc
	test -f public/doc/index.html
	test -L public/doc/js/jquery.js -a -f public/doc/js/jquery.js
	test -L public/jquery.js -a -f public/jquery.js
55
	test -L public/bootstrap
Antonio Terceiro's avatar
Antonio Terceiro committed
56

57 58
test: check

59 60
doc: public/doc/index.html public/doc/architecture.svg

61
public/doc/index.html public/doc/jq/jquery.js: README.md $(sort $(wildcard docs/*.md)) $(shell find lib -name '*.rb' | LC_ALL=C sort)
62
	$(RM) public/doc/js/jquery.js
63
	yardoc --markup markdown --output-dir public/doc --main README.md lib - $^
Antonio Terceiro's avatar
Antonio Terceiro committed
64
	ln -sf ../../jquery.js public/doc/js/jquery.js
65

66 67
public/doc/architecture.svg: docs/architecture.svg
	cp docs/architecture.svg public/doc/
68

69 70 71 72 73 74
$(MANPAGES): man/%.1: bin/% man
	pod2man --center "" --release "" --section=1 --utf8 $< $@

man:
	mkdir $@

75 76 77
.PHONY: tags

tags:
78
	ctags -R --exclude=data --exclude=chroots --exclude='public/jquery*' --exclude=public/bootstrap .
79

80
clean:
81
	$(RM) -rf $(generated) tags public/doc links.mk $(LINKS) man/