# FILE. . . . . /home/hak/hlt/src/Makefile
# EDIT BY . . . Hassan Ait-Kaci
# ON MACHINE. . Hp-Dv7
# STARTED ON. . Wed Aug 01 23:35:20 2012
########################################################################
# Last modified on Wed Dec 18 10:13:02 2019 by hak
########################################################################

# This generates the javadoc API documentation into ~/hlt/doc/hlt/api/index.html

# NB: make does not understand /cygdrive/d - its needs D:
WIN_HOME	= D:/hak
HLT_HOME	= ${WIN_HOME}/hlt
PACKROOT	= hlt
CLASSROOT	= $(HLT_HOME)/classes
CLASSPATH	= $(CLASSROOT);$(CLASSROOT)/jdom.jar
SOURCEROOT	= $(HLT_HOME)/src
OPTIONS		= -windowtitle "API documentation of hlt.language packages" \
                  -author -version -public $(TAGS) \
                  -header "Author: <a href=\"http://www.hassan-ait-kaci.net\">Hassan A&iuml;t-Kaci</a>" \
                  -footer "Contact: <a href=\"mailto:hak@acm.org?subject=hlt%20packages\">hak@acm.org</a>"
TAGS		= -tag copyright:p:"Copyright:"
# In order to see javadoc warnings (and potential errors) comment out what follows -quiet in HUSH:
HUSH		= -quiet > /dev/null 2> /dev/null
APIDIR		= $(HLT_HOME)/doc/${PACKROOT}/api

SAY	= @echo "***"

MK	= @/usr/bin/make
ND	= @/usr/bin/mkdir -p
CP	= @/usr/bin/cp -f
CD	= @/usr/bin/cd
LS	= @/usr/bin/ls
MV	= @/usr/bin/mv -f
RM	= @/usr/bin/rm -f -r
CL	= @/usr/bin/rm -f -r ${TRASH} 2> /dev/null || true

TRASH		= **/,* **/,.* **/*~ **/@*@ **/.*~ **/core \
		  */**/,* */**/,.* */**/*~ */**/@*@ */**/.*~ */**/core \
		  */*/**/,* */*/**/,.* */*/**/*~ */*/**/@*@ */*/**/.*~ */*/**/core \
		  */*/*/**/,* */*/*/**/,.* */*/*/**/*~ */*/*/**/@*@ */*/*/**/.*~ */*/*/**/core

SYSTEM		= $(PACKROOT).language
DESIGN		= $(SYSTEM).design

PACKAGES	= $(PACKROOT).fot\
		  $(PACKROOT).fot.fuz\
		  $(PACKROOT).math.matrix\
		  $(PACKROOT).math.fuzzy\
		  $(PACKROOT).osf.base\
		  $(PACKROOT).osf.util\
		  $(PACKROOT).osf.io\
		  $(PACKROOT).osf.exec\
		  $(SYSTEM).util\
		  $(SYSTEM).io\
		  $(SYSTEM).tools\
		  $(SYSTEM).syntax\
		  $(DESIGN).kernel\
		  $(DESIGN).types\
		  $(DESIGN).instructions\
		  $(DESIGN).backend


########################################################################
help, info : tidy
	$(SAY) You can \"make\" one of:
	$(SAY) "	all	to generate the Javadoc API documentation for the $(PACKROOT) packages"
	$(SAY) "	api	to do the same"
	$(SAY) "	help	to print this information"
	$(SAY) "	info	to do the same"
########################################################################
all, api : clean
	$(SAY) Generating Javadoc API documentation for $(PACKROOT) packages # $(PACKAGES)
	$(SAY) Be patient: this may take a while...
	@javadoc -html4 -J-Xmx128m -classpath "$(CLASSPATH)" -sourcepath "$(SOURCEROOT)" -d "$(APIDIR)" $(OPTIONS) $(PACKAGES) # 2> /dev/null || true #$(HUSH)
	$(SAY) Wrote javadoc root file $(APIDIR)/index.html
########################################################################
clean : tidy
	$(SAY) Deleting old API documentation for $(PACKROOT) packages
	@\rm -rf $(APIDIR)/[a-z]*
	@\rm -rf $(APIDIR)/*.html
########################################################################
tidy:
	${SAY} "Tidying up trash"
	${LS} ${TRASH} 2> /dev/null || true
	${RM} ${TRASH} 2> /dev/null || true

########################################################################
