Makefile 1011 Bytes
all:
	@echo "Usage:"
	@echo
	@echo "make html				Builds the documentation in HTML"
	@echo "make latexpdf		Builds the documentation in PDF"

SPB_ENV ?= local

build_dir = _build/$(SPB_ENV)

# autogenerated DNS documentation
BUILT += $(build_dir)/dns.rst
$(build_dir)/dns.rst: ../test/dns_test.sh
	mkdir -p $(build_dir)
	(cd .. && sh test/dns_test.sh --doc) > $@

BUILT += $(patsubst %.svg, $(build_dir)/%.png, $(wildcard *.svg))
$(build_dir)/%.png: %.png
	mkdir -p $(build_dir)
	cp $< $@

ssh.png:
	inkscape --export-area-page --export-width=800 --export-width=600 --export-png=$@ $<

arquitetura.png:
	inkscape --export-area-page --export-width=800 --export-width=600 --export-png=$@ $<

BUILT += $(patsubst %.in, $(build_dir)/%, $(wildcard *.in))
$(build_dir)/%: %.in build.rb
	mkdir -p $(build_dir)
	ruby -p build.rb $< > $@ || ($(RM) $@; false)

CLEAN_FILES += $(BUILT)

html latexpdf: $(BUILT)
	mkdir -p $(build_dir)
	$(MAKE) -C $(build_dir) -f ../Makefile $@

clean:
	$(RM) $(BUILT)
	$(RM) -r $(build_dir)