###############################################################################
# BRLTTY - A background process providing access to the Linux console (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation.  Please see the file COPYING for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

include $(BLD_TOP)/config.mk
ABS_SRC_DIR = @abs_srcdir@

all: Manual BrlAPI $(BUILD_API)

LOCALE = C
SETLOCALE = LC_ALL=$(LOCALE)

Manual: Manual.txt Manual.made

BrlAPI: BrlAPI.txt BrlAPI.made

api: BrlAPIref.made

BrlAPIref.made: $(SRC_TOP)$(PGM_DIR)/brlapi.h BrlAPIref.doxy
	doxygen BrlAPIref.doxy
	ln -sf man3/brlapi_*.3 .
	touch $@

%.txt: $(SRC_DIR)/%.sgml
	$(SETLOCALE) sgml2txt -l english -c latin $<

%.made: $(ABS_SRC_DIR)/%.sgml
	$(INSTALL_DIRECTORY) $*-HTML
	cd $*-HTML && $(SETLOCALE) sgml2html -l english -c ascii $<
	touch $@

clean::
	-rm -f *.made *.txt brlapi_*.3
	-rm -fr *-HTML man?

distclean::
	-rm -f BrlAPIref.doxy

