DEPTH = ..

include $(DEPTH)/Makefile.version
include $(DEPTH)/Makefile.os
include $(DEPTH)/Makefile.install.directories

# the subdirectories
DIRECTORIES = de \
	      en

# make all (nothing)
.PHONY: all
all :

.PHONY: install
install :
	mkdir -p $(DESTDIR)$(HELP_DIRECTORY)/manual
	rsync -r --links --exclude "Makefile*" --exclude "*.sh" --exclude .gitignore . $(DESTDIR)$(HELP_DIRECTORY)/manual
	-restorecon -F -r $(DESTDIR)$(HELP_DIRECTORY)

# copy the manual in the release directory
.PHONY: release
release :
	mkdir -p $(RELEASE_TMP)/FreeDoko_$(VERSION)/doc/manual
	tar -c --exclude=Makefile . \
	   | tar xC $(RELEASE_TMP)/FreeDoko_$(VERSION)/doc/manual

# update the date in the html files
.PHONY: update_date
update_date :
	for d in $(DIRECTORIES); do \
	  $(MAKE) -C $$d $@; \
	done

# check the html files (uses 'tidy')
.PHONY: check
check :
	for f in *.html; do \
	  if [ -f $$f ]; then \
	    echo $$f; \
	    tidy -utf8 -e $$f 2>/dev/null \
	    || tidy -utf8 -e $$f \
	    || exit 1; \
	  fi \
	done
	for d in $(DIRECTORIES); do \
	  $(MAKE) -C $$d $@; \
	done
