MMakefile 31.1 KB
Newer Older
huet's avatar
huet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
############################################################################
#                                                                          #
#                      The Sanskrit Heritage Platform                      #
#                                                                          #
#                         Gérard Huet & Pawan Goyal                        #
#                                                                          #
############################################################################
#TEMPLATE Makefile of SKT Platform      #DATE      Copyright Gérard Huet 2017 #
############################################################################
#WARN

# This software presupposes a Unix-like OS environment, with c, make and sed
# Also python is assumed for package management, and javascript for scripts.
# Stand-alone distribution ought to include Zen and Ocaml/Camlp4 distributions.
15
# Also Apache2 for managing the Web site.
huet's avatar
huet committed
16 17 18 19

############################ VERSIONING ####################################

# If you change VERSION/DATE: ./configure (triggering make version)
20
# and separately update lexicon version counter in Heritage.e
huet's avatar
huet committed
21 22 23 24 25 26 27 28 29
VERSION=#VERSION
# DATE ought to be of the form YYYY-MM-DD, consistently with ISO 8601
DATE=#DATE

# Sanskrit resources are defined at configuration time:
SKTRESOURCES=#SKTRESOURCES

DATA=$(SKTRESOURCES)DATA# morphological data and transducers
HERITAGE=$(SKTRESOURCES)DICO# hypertext Heritage read-only
30
DICO=DICO# hypertext Heritage
huet's avatar
huet committed
31 32 33 34 35
BOOK=$(SKTRESOURCES)BOOK# Heritage.pdf abrevs.pdf
MW=$(SKTRESOURCES)MW# hypertext Monier-Williams
GOLD=$(SKTRESOURCES)GOLD# Heritage in Goldendict format databases
XMLBANKS=$(SKTRESOURCES)XML# Heritage Sanskrit morphology in XML databases

36 37 38 39 40 41
# Path to global Sanskrit corpus downloaded from Git.
SKTCORPUS = #SKTCORPUS

# Path to the corpus in the server area.
SERVERCORPUS = $(SERVERPUBLICDIR)CORPUS

huet's avatar
huet committed
42
# Virtual path for make
43
VPATH=ML
huet's avatar
huet committed
44 45 46 47 48 49 50

# For change of make in all recursive Makefiles
MAKE=make
SHELL=/bin/sh

############### Distribution Parameterization Begin #########################

51
# Distribution licenses - depends on the packages selection
huet's avatar
huet committed
52 53 54
# LGPL distribution Kerala workshop 25-12-2011 Happy Christmas !
# LGPL distribution WSC Conference Bangkok 25-06-2015
# GitLab archive 15-04-2017
55
# SCL parser interface 02-06-2017
huet's avatar
huet committed
56 57 58

SOFT_LICENSE=LEGAL/LGPL/LICENSE # Free software license LGPL
#SOFT_LICENSE=LEGAL/UoH/LICENSE # University of Hyderabad distribution
59
DATA_LICENSE=$(DATA)/LGPLLR.pdf
huet's avatar
huet committed
60 61 62 63
DATA_LICENSES=$(DATA)/LGPLLR.pdf $(DATA)/LGPLLR.tex $(DATA)/LGPLLR.html
LICENSES=$(SOFT_LICENSE) $(DATA_LICENSE)

ML_COPYRIGHT=ML/COPYRIGHT
64
LEGAL=$(ML_COPYRIGHT) $(LICENSES)
huet's avatar
huet committed
65 66 67 68 69 70 71 72 73 74 75 76 77

CONFIGS=SETUP/CONFIGS SETUP/config_help.txt

# System installation
SYSTEM_SETUP=SETUP/version.txt SETUP/MMakefile SETUP/INSTALL $(CONFIGS) \
SETUP/issudo.sh SETUP/counter.py SETUP/zen.tar
SYSTEM_configure=configure
# currently disabled
SYSTEM_supplements=SETUP/TEX SETUP/wwwcount2.5.tar.gz

# General information
INFOS=README INSTALLATION

Gérard Huet's avatar
Gérard Huet committed
78 79
INRIA_IMAGES=IMAGES/icon_ocaml.png IMAGES/JoeCaml.png \
IMAGES/logo_inria.png # Copyright Inria
huet's avatar
huet committed
80 81 82 83 84 85 86 87 88 89 90 91
# W3C_IMAGES=IMAGES/valid-xhtml10.png # Copy W3C - obsolete
GH_IMAGES=IMAGES/smallyantra.gif IMAGES/Yantra.jpg IMAGES/favicon.ico \
IMAGES/apple-touch-icon-ipad-76x76.png \
IMAGES/apple-touch-icon-ipad-retina-152x152.png \
IMAGES/apple-touch-icon-iphone-60x60.png \
IMAGES/apple-touch-icon-iphone-retina-120x120.png # Copy GH
DOC_IMAGES=IMAGES/lexer10.jpg IMAGES/lexer17.jpg IMAGES/lexer40.jpg # Copy GH
# These gif images are various simplifications of the lexer automaton
# They were compiled by GraphViz from DOC/lexer10.dot lexer17.dot lexer40.dot
# NB. Use of gif vs others formats such as jpg is due to browser compatibility

# Scripts
92
SCRIPTS=JAVASCRIPT/utf82VH.js JAVASCRIPT/dragtable.js
huet's avatar
huet committed
93

94
# Next are copyright specific images
huet's avatar
huet committed
95
SITE_IMAGES=IMAGES/yinyang.gif IMAGES/panini.jpg IMAGES/spin-new.gif \
96 97 98
IMAGES/arrw01_06a.gif IMAGES/arrw01_16a.gif
TOP_IMAGES=IMAGES/sanskrit.gif IMAGES/borderl.jpg IMAGES/borderr.jpg
BACK_IMAGES=IMAGES/om.jpg IMAGES/om1.jpg IMAGES/om2.jpg IMAGES/om3.jpg IMAGES/om4.jpg
huet's avatar
huet committed
99 100 101 102 103 104
MISC_IMAGES=IMAGES/ganesh.gif IMAGES/ganesh.jpg IMAGES/jagannath.jpg \
IMAGES/hare.jpg IMAGES/ganeshgannath.jpg IMAGES/krishnagannath.jpg \
IMAGES/jagannath2.jpg IMAGES/sarasvati.jpg IMAGES/Panini2.jpg \
IMAGES/jaganyantra.png IMAGES/geopattern.gif IMAGES/vajra.jpg \
IMAGES/kaadambarii.png IMAGES/vajra.png

105
# Distributed images for mirror Web site
huet's avatar
huet committed
106 107 108 109 110 111 112 113 114
#IMAGES= # no image in distribution
IMAGES=$(INRIA_IMAGES) $(GH_IMAGES) $(SITE_IMAGES) $(TOP_IMAGES) \
$(BACK_IMAGES) $(DOC_IMAGES) $(MISC_IMAGES)

# Fonts for diacritics and devanagari - OBSOLETE
# diacritics: tim-iu.zip 'IndUni' font courtesy John Smith, Cambridge
# devanagari: it99otf.zip 'Sanskrit 99' font courtesy Ulrich Stiehl, Heidelberg
# FONTS=FONTS/tim-iu.zip FONTS/it99otf.zip

115
# Lexical databases
huet's avatar
huet committed
116 117 118 119 120 121 122 123 124 125 126 127 128
DIC_PDF=Heritage.pdf
DIC_HTML=Heritage.html #in 1 page! (used for Goldendict format translation)

############### Distribution Parameterization End #########################

####################### Customization Begin ###############################

# Installation parameters - Customize by ./configure in main dir
# according to the config file in SETUP dir
PLATFORM=#PLATFORM# Computer or Station -- no blank character in such strings
# PLATFORM=Simputer# Amida Simputer handheld device - historical

TRANSLIT=#TRANSLIT# Transliteration scheme VH, KH or WX
129
LEXICON=#LEXICON# Lexicon toggle default
huet's avatar
huet committed
130 131 132
DISPLAY=#DISPLAY# Default display font deva or roma

# Main directory, where the sanskrit tools are installed
133
SKTINSTALLDIR=#SKTINSTALLDIR# To be set at configuration time
huet's avatar
huet committed
134 135 136 137

# Host name of the server - used only for installation message below
SERVERHOST=#SERVERHOST
# SERVERHOST=sanskrit.inria.fr# quincy sanskrit [official site]
138
# SERVERHOST=pauillac.inria.fr# pauillac
huet's avatar
huet committed
139
# SERVERHOST=213.41.153.152# dhruva gerardh.net1.nerim.net [legacy]
140 141 142

# For remote invocation of cgi services (eg Sanskrit Library)
REMOTESERVERHOST=http://sanskrit.inria.fr/# remote host Inria
huet's avatar
huet committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181

# The SKT public http directory on the server
SERVERPUBLICDIR=#SERVERPUBLICDIR
# SERVERPUBLICDIR=/Users/huet/Sites/SKT/# amrita
# SERVERPUBLICDIR=/var/www/html/sanskrit/# quincy/sanskrit

# Its local URL on the server
SKTDIRURL=#SKTDIRURL

# URL where to look for cgis
CGIBINURL=#CGIBINURL
# CGIBINURL=/cgi-bin/# amrita sanskrit

# The httpd server executables directory
CGIDIR=#CGIDIR
# CGIDIR=/Library/WebServer/CGI-Executables/# amrita [Mac OSX]
# CGIDIR=/home/httpd/cgi-bin/# pushpak [WindowsNT]
# CGIDIR=/var/www/cgi-bin/# dhruva [Linux Redhat]
# CGIDIR=/var/www/cgi-bin/SKT/# sanskrit [Linux Ubuntu]

# Extension suffix of cgis
CGIEXT=#CGIEXT
# CGIEXT=# amrita sanskrit

# cgi name under which the lexicon index is installed on the server
CGIINDEX=sktindex$(CGIEXT)
# cgi name under which the search facility is installed on the server
CGIINDEXD=sktsearch$(CGIEXT)
# cgi name under which the declension engine is installed on the server
CGIDECL=sktdeclin$(CGIEXT)
# cgi name under which the conjugation engine is installed on the server
CGICONJ=sktconjug$(CGIEXT)
# cgi name under which the sanskrit lemmatizer is installed on the server
CGILEMMA=sktlemmatizer$(CGIEXT)
# cgi name under which the sanskrit reader is installed on the server
CGIREADER=sktreader$(CGIEXT)
# cgi name under which the sanskrit parser is installed on the server
CGIPARSER=sktparser$(CGIEXT)
# cgi name reserved for sanskrit tagger (* unused in current version *)
182
CGITAGGER=skttagger$(CGIEXT)
huet's avatar
huet committed
183 184 185 186 187 188
# cgi name under which the sanskrit sandhi segmenter is installed on the server
CGISANDHI=sktsandhier$(CGIEXT)
# cgi name under which the sanskrit tagging summarizer is installed on the server
CGIGRAPH=sktgraph$(CGIEXT)
# cgi name under which the user aid for unknown chunks is installed on the server
CGIUSER=sktuser$(CGIEXT)
189 190
# CGI name under which the corpus manager is installed on the server.
CGIMANAGER = manager$(CGIEXT)
Idir Lankri's avatar
Idir Lankri committed
191 192 193
# CGI name under which the program that enriches the corpus is installed
# on the server.
CGIADDCORPUS = addcorpus$(CGIEXT)
194

huet's avatar
huet committed
195 196 197 198 199 200 201 202 203
# what mouse action to use for viewing lemmatization
MOUSEACTION=#MOUSEACTION
# MOUSEACTION='CLICK'#amrita

# The web server home page (reserved for server administrator)
# SERVERPAGE=/Library/WebServer/Documents/index.html.fr # amrita [Mac OSX]
# SERVERPAGE=/var/www/html/sanskrit/index.html # quincy [Linux, virtual server]
# SERVERPAGE=/var/www/html/index.html # dhruva [Linux, direct server]

204
# Customisation of SCL platform interface - under rehaul
huet's avatar
huet committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
SCLURL=#SCLURL
SCLINSTALLDIR=#SCLINSTALLDIR
OUTPUTFONT=#OUTPUTFONT
TEMPAREA=#TEMPAREA

#################### Customization End ######################################

##########
# Macros #
##########

# System sources packages

# CORE is needed by all other packages - as well as the ZEN library
# GRAM is needed to generate the Sanskrit Heritage Engine
220
# WEB is needed to create the web pages and cgi-bin executables
huet's avatar
huet committed
221

222
# Les packages de modules - Tous dans la bibliothèque ML
huet's avatar
huet committed
223 224 225
# Linked to the ZEN library (generic Ocaml computational linguistic library)

# UTIL utilities for ML folder
226
UTIL=ML/Makefile $(ML_COPYRIGHT) ML/.ocamlinit ML/.depend
huet's avatar
huet committed
227 228 229 230

# CORE package - utilities, transducers, sanskrit and french lexers, dico spec
DISTR_CORE=ML/control.ml ML/dico.mli ML/version.ml ML/date.ml ML/install.ml \
ML/canon.ml ML/transduction.ml ML/encode.ml ML/order.ml ML/padapatha \
231 232
ML/sanskrit.mli ML/sanskrit.ml ML/french.mli ML/french.ml ML/skt_lexer.ml \
ML/dir.mli ML/dir.ml
233
CORE=$(DISTR_CORE) ML/paths.ml
huet's avatar
huet committed
234 235 236 237 238 239 240 241 242

# GRAM package - phonetics, morphology, segmentation and tagging engines
GRAM=ML/index.ml ML/phonetics.ml ML/int_sandhi.ml ML/morphology.mli \
ML/naming.ml ML/inflected.mli ML/inflected.ml ML/sandhi.ml ML/sandhicheck.ml \
ML/sandhier.ml ML/pada.ml ML/nouns.mli ML/nouns.ml ML/conj_infos.mli \
ML/verbs.mli ML/verbs.ml ML/parts.ml ML/morpho.ml ML/declension.ml \
ML/conjugation.ml ML/indexer.ml ML/indexerd.ml ML/phases.ml ML/lemmatizer.ml \
ML/auto.mli ML/load_transducers.ml ML/dispatcher.mli ML/dispatcher.ml \
ML/morpho_string.ml ML/segmenter.ml ML/load_morphs.ml ML/lexer.mli ML/lexer.ml \
243
ML/rank.ml ML/scl_parser.ml ML/reader.ml ML/parser.ml ML/constraints.mli \
huet's avatar
huet committed
244
ML/constraints.ml ML/multilingual.ml ML/paraphrase.mli ML/paraphrase.ml \
245
ML/bank_lexer.ml ML/regression.ml ML/checkpoints.ml \
huet's avatar
huet committed
246
ML/graph_segmenter.ml ML/interface.mli ML/interface.ml ML/user_aid.ml \
247
ML/reset_caches.ml ML/interfaceParams.mli ML/InterfaceParams.ml
huet's avatar
huet committed
248 249 250 251

# WEB package - HTML, HTTP, CGI ad-hoc utilities for Web interface
WEB=ML/html.ml ML/web.ml ML/css.ml ML/cgi.ml ML/morpho_html.ml ML/chapters.ml \
ML/mk_index_page.ml ML/mk_grammar_page.ml ML/mk_reader_page.ml \
Idir Lankri's avatar
Idir Lankri committed
252 253
ML/mk_sandhi_page.ml ML/morpho_scl.ml ML/compute_mw_links.ml ML/manager.ml \
ML/add_corpus.ml
huet's avatar
huet committed
254 255 256

# TREE package - tree bank manager and syntax analyser - deprecated
TREE=ML/stemmer.ml ML/parse_tree.ml ML/parse_apte.ml ML/tag_tree.ml \
257
ML/tag_apte.ml
huet's avatar
huet committed
258

259
DEBUG= ML/morpho_debug.ml ML/debug.ml
huet's avatar
huet committed
260

261
# Historical versions of the segmenter, tagger and reader with single phase
huet's avatar
huet committed
262 263 264 265 266
OBSOLETE_ML=ML/segmenter1.ml ML/tagger1.ml ML/reader1.ml ML/tagger.ml \
ML/nyaaya.ml ML/mk_nyaaya_page.ml \
ML/patch_auto.ml # awful hack for patching automata structures - now unused

# Modules of all software packages are in library ML (besides the ZEN library)
267
ML=$(UTIL) $(CORE) $(GRAM) $(WEB) $(TREE) $(LEGAL)
huet's avatar
huet committed
268 269 270 271 272 273 274 275

# Directory STAT contains a few log and regression files like regression_template
# Also files mw_exc.txt and mw_index_txt_file.txt for Monier-Williams alignment
STAT=STAT

# dynamic statistics such as current regression file
VAR=VAR

276 277
# System documentation
DOC=DOC/doc.ps DOC/doc.html DOC/doc.pdf
huet's avatar
huet committed
278 279 280 281 282 283
# documentation source # needs ocamlweb and hevea to create documentation
DOCSOURCE=DOC/docintro DOC/ocamlweb.sty DOC/lexer10.dot DOC/lexer17.dot DOC/lexer40.dot
# Site entry page and XML entry page
SITESOURCE=SITE/site_entry_page SITE/xml_entry_page SITE/goldendict_entry_page
SITEPAGE_FR=SITE/index.fr.html
SITEPAGE_EN=SITE/index.en.html
284
SITEPAGES=$(SITEPAGE_FR) $(SITEPAGE_EN)
huet's avatar
huet committed
285 286
PORTALPAGE_FR=SITE/portal.fr.html
PORTALPAGE_EN=SITE/portal.en.html
287
PORTALPAGES=$(PORTALPAGE_FR) $(PORTALPAGE_EN)
huet's avatar
huet committed
288 289
FAQPAGE_FR=SITE/faq.fr.html
FAQPAGE_EN=SITE/faq.en.html
290
FAQPAGES=$(FAQPAGE_FR) $(FAQPAGE_EN)
huet's avatar
huet committed
291
MANUAL=SITE/manual.html
Gérard Huet's avatar
Gérard Huet committed
292 293 294
XMLPAGE=SITE/xml.html
FAQ=SITE/faq.html
PORTAL=SITE/portal.html
huet's avatar
huet committed
295
GOLD=SITE/gold.html
Gérard Huet's avatar
Gérard Huet committed
296 297 298
GOLDEN=SITE/goldendict.html
ABREVS=SITE/abrevs.pdf
ROBOTS=SITE/robots.txt # currently disabled to allow Google access
huet's avatar
huet committed
299

300 301 302
# Goldendict data banks are now distributed from sanskrit.inria.fr
#GOLDENDICT=SITE/Heritage_du_sanskrit_san-fra.tar.gz SITE/Declension-heritage_du_sanskrit_san-eng.tar.gz SITE/Grammar-heritage_du_sanskrit_san-eng.tar.gz SITE/mw-heritage_du_sanskrit_san-eng.tar.gz

303
WEBSOURCES=$(PORTAL) $(FAQ) $(ABREVS) $(GOLD) $(GOLDEN) $(MANUAL) $(XMLPAGE)
304
ALLWEBSOURCES=$(SITESOURCE) $(WEBSOURCES)
huet's avatar
huet committed
305 306 307 308 309 310
# Sources of morphology documents
XMLDATA=$(DATA)/XML
DATASOURCE=$(DATA)/titn.tex $(DATA)/titpn.tex $(DATA)/titr.tex $(DATA)/titp.tex \
$(DATA)/tita.tex $(DATA)/titb.tex $(DATA)/titf.tex $(DATA)/titi.tex \
$(DATA)/titv.tex $(DATA)/tity.tex $(DATA)/titc.tex \
$(XMLDATA)/SL_morph.dtd $(XMLDATA)/WX_morph.dtd \
311 312 313
$(DATA_LICENSES) $(DATA)/Makefile
# All data sources
SOURCE=$(DOCSOURCE) $(DATASOURCE) $(ALLWEBSOURCES)
huet's avatar
huet committed
314

315 316
# Miscellaneous documentation
OBSOLETE_DOCS=DOC/sanskrit.pdf
huet's avatar
huet committed
317
DOCS=DOC/sanskrit.pdf DOC/wsc.pdf DOC/tagger.pdf DOC/wcre.pdf DOC/coling.pdf \
318
DOC/Mumbai.pdf DOC/Brown.pdf DOC/IWRIDL.pdf DOC/COLING_2012.pdf DOC/WSC13.pdf
huet's avatar
huet committed
319
DOC_ML=DOC/Heritage_Platform.pdf
320
# Automata databases for use by the Sanskrit Engine
huet's avatar
huet committed
321 322 323 324 325 326

AUTOMATA=$(DATA)/nouns.rem $(DATA)/roots.rem $(DATA)/preverbs.rem \
$(DATA)/lopas.rem $(DATA)/pronouns.rem $(DATA)/transpn.rem $(DATA)/parts.rem \
$(DATA)/lopaks.rem $(DATA)/indecls.rem $(DATA)/abstvaa.rem $(DATA)/absya.rem \
$(DATA)/iics.rem $(DATA)/piics.rem $(DATA)/ifcs.rem $(DATA)/iivs.rem \
$(DATA)/iifcs.rem $(DATA)/auxi.rem $(DATA)/voca.rem $(DATA)/invs.rem \
327 328 329
$(DATA)/inftu.rem $(DATA)/kama.rem $(DATA)/nouns2.rem $(DATA)/iics2.rem \
$(DATA)/avyayais.rem $(DATA)/avyayafs.rem $(DATA)/ifcs2.rem $(DATA)/sandhis.rem \
$(DATA)/sandhis_pv.rem $(DATA)/sandhis_ph.rem $(DATA)/peris.rem \
huet's avatar
huet committed
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
$(DATA)/transperi.rem $(DATA)/transn.rem $(DATA)/transr.rem \
$(DATA)/transiiy.rem $(DATA)/transavy.rem $(DATA)/transp.rem \
$(DATA)/transpa.rem $(DATA)/transic.rem $(DATA)/sfxs.rem $(DATA)/isfxs.rem \
$(DATA)/transsfx.rem $(DATA)/transisfx.rem $(DATA)/transif.rem \
$(DATA)/transpic.rem $(DATA)/transiif.rem $(DATA)/transabsya.rem \
$(DATA)/transabstvaa.rem $(DATA)/transiv.rem $(DATA)/transinde.rem \
$(DATA)/partvocs.rem $(DATA)/transpav.rem $(DATA)/translopak.rem \
$(DATA)/transauxi.rem $(DATA)/transvoca.rem $(DATA)/translopa.rem \
$(DATA)/transn2.rem $(DATA)/transif2.rem $(DATA)/transic2.rem \
$(DATA)/auxik.rem $(DATA)/auxiick.rem $(DATA)/transauxik.rem \
$(DATA)/transauxiick.rem $(DATA)/transinv.rem \
$(DATA)/transinftu.rem $(DATA)/transkama.rem \
$(DATA)/roots_infos.rem $(DATA)/roots_usage.rem \
$(DATA)/sandhis_id.rem $(DATA)/unique_kridantas.rem $(DATA)/lexical_kridantas.rem

# roots_infos.rem is used at run time for generating abs and ger of verbs
346
# roots_usage.rem is used at run time by Dispatcher.validate
huet's avatar
huet committed
347 348
# sandhis_id.rem is used at run time by Segmenter
# lexical_kridantas.rem is used at run time by the loading of inflected.cmx
349
# by cgis declension and conjugation
huet's avatar
huet committed
350

351 352
# Persistent Ocaml values files stored in DICO dir for indexing purposes
DICOREMS=entries.rem defs.rem dummies.rem
huet's avatar
huet committed
353 354 355 356 357 358 359 360
# data files for MW linking
DATAMW=$(DATA)/mw_exceptions.rem $(DATA)/mw_index.rem $(DATA)/guess_index.rem

# cache related files in $(SERVERPUBLICDIR)$(DATA)
CACHES=cache.txt cache.rem minica.rem transca.rem

# Linguistic resources: Sanskrit morphology documents

361 362 363
PDF_MORPHOLOGY=$(DATA)/nouns.pdf $(DATA)/roots.pdf $(DATA)/parts.pdf \
$(DATA)/indecls.pdf $(DATA)/final.pdf # enormous, useless

huet's avatar
huet committed
364 365 366 367 368
SL_XML_MORPHOLOGY=$(XMLDATA)/SL_morph.tar.gz
WX_XML_MORPHOLOGY=$(XMLDATA)/WX_morph.tar.gz
XML_DTD=$(XMLDATA)/SL_morph.dtd $(XMLDATA)/WX_morph.dtd
XML_MORPHOLOGY=$(SL_XML_MORPHOLOGY) $(WX_XML_MORPHOLOGY) $(XML_DTD)

369
# Various test examples
huet's avatar
huet committed
370 371 372 373 374 375 376
# CORPUS=CORPUS/APTE CORPUS/Baladarza CORPUS/NN CORPUS/S_Raama CORPUS/REGRESSION

###########
# Scripts #
###########

# Sanskrit Heritage Platform site construction; release with "make release"
377
all: ZEN
378
	test -e $(DATA) && echo "Heritage_Resources detected" && exit 0 \
379
|| echo "You should first install Heritage_Resources at $(DATA)" && exit 1
huet's avatar
huet committed
380
	cd ZEN && $(MAKE) all
381
	cp -Rp $(HERITAGE) . # local copy of DICO from Resources/DICO
huet's avatar
huet committed
382
	cp -Rp $(MW) . # local copy of MW
huet's avatar
huet committed
383
#	cd ML && $(MAKE) depend # reset dependencies (might be partial subset)
384
	test -e ML/SCLpaths.ml && echo "SCL config detected" \
385
|| cp SETUP/dummy_SCLpaths.ml ML/SCLpaths.ml
386 387 388
	cd ML && $(MAKE) test_version
	ML/test_stamp
	cd ML && $(MAKE) # make engine (testing the data stamp)
huet's avatar
huet committed
389 390 391 392 393 394 395
	$(MAKE) web_services # then all Web services

# When master Makefile SETUP/MMakefile has been changed, do manually:
new:
	./configure
	$(MAKE) all

396
# After updating installation parameters above, the python script configure
397
# regenerates Makefile from SETUP/MMakefile and executes "make configuration"
398
configuration:
huet's avatar
huet committed
399 400 401 402 403 404 405 406
	(cat $(ML_COPYRIGHT) ; \
echo "(* Do not edit by hand - generated by configuration script - see main Makefile *)"; \
echo 'value platform = "$(PLATFORM)"'; \
echo 'and default_transliteration = "$(TRANSLIT)"'; \
echo 'and default_lexicon = "$(LEXICON)"'; \
echo 'and default_display_font = "$(DISPLAY)"'; \
echo 'and skt_install_dir = "$(SKTINSTALLDIR)"'; \
echo 'and skt_resources_dir = "$(SKTRESOURCES)"'; \
407
echo 'and skt_corpus_dir = "$(SKTCORPUS)"'; \
huet's avatar
huet committed
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
echo 'and public_skt_dir = "$(SERVERPUBLICDIR)"'; \
echo 'and skt_dir_url = "$(SKTDIRURL)"'; \
echo 'and server_host = "$(SERVERHOST)"'; \
echo 'and remote_server_host = "$(REMOTESERVERHOST)"'; \
echo 'and cgi_dir_url = "$(CGIBINURL)"'; \
echo 'and cgi_index = "$(CGIINDEX)"'; \
echo 'and cgi_indexd = "$(CGIINDEXD)"'; \
echo 'and cgi_lemmatizer = "$(CGILEMMA)"'; \
echo 'and cgi_reader = "$(CGIREADER)"'; \
echo 'and cgi_parser = "$(CGIPARSER)"'; \
echo 'and cgi_tagger = "$(CGITAGGER)"'; \
echo 'and cgi_decl = "$(CGIDECL)"'; \
echo 'and cgi_conj = "$(CGICONJ)"'; \
echo 'and cgi_sandhier = "$(CGISANDHI)"'; \
echo 'and cgi_graph = "$(CGIGRAPH)"'; \
echo 'and cgi_user_aid = "$(CGIUSER)"'; \
424
echo 'and cgi_manager = "$(CGIMANAGER)"'; \
Idir Lankri's avatar
Idir Lankri committed
425
echo 'and cgi_add_corpus = "$(CGIADDCORPUS)"'; \
426
echo 'and mouse_action = "$(MOUSEACTION)";') > ML/paths.ml
huet's avatar
huet committed
427 428 429 430 431 432 433 434 435 436 437 438
	$(MAKE) version

version:
	(cat $(ML_COPYRIGHT); \
echo "(* Generated by make version - see main Makefile *)"; \
echo "value version=\"$(VERSION)\" and version_date=\"$(DATE)\";") > ML/version.ml

full: ZEN
	cd ML && $(MAKE) clean && $(MAKE) depend && $(MAKE) all
	$(MAKE) all
	$(MAKE) supplements

439
supplements:
huet's avatar
huet committed
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
	cd $(DATA) && $(MAKE) statistics
	cd $(DATA) && $(MAKE) pdf
	cd $(XMLDATA) && $(MAKE) xml
	cd ML && $(MAKE) doc # requires installing ocamlweb

index.html: mk_index_page
	ML/mk_index_page

reader.html: mk_reader_page
	ML/mk_reader_page -en
	ML/mk_reader_page -fr

grammar.html: mk_grammar_page
	ML/mk_grammar_page

sandhi.html: mk_sandhi_page
	ML/mk_sandhi_page

style.css: css
	ML/css

Makefile: SETUP/MMakefile
	./configure
463

huet's avatar
huet committed
464
## Following entry points make partial update/installation on the local server
465
## they need su privilege for writing in the server area
huet's avatar
huet committed
466 467 468 469

# beware - make web_services on server architecture after DICO before releasecgi
# necessary if mk_*_page.ml has been updated
web_services: # Will write localized site pages in DICO and export cgis
470
	cd ML && $(MAKE) cgis site_pages
Gérard Huet's avatar
Gérard Huet committed
471
	cp -p SITE/xml.html DICO
huet's avatar
huet committed
472

473
release: $(DICO) web_services releasecgi releaseMW releasedata releasedoc \
Gérard Huet's avatar
Gérard Huet committed
474 475
releasebook
# releasexml - no XML release on server - lookup Heritage_Resources
476
# releasepdf disabled at present as bulky and un-finished
huet's avatar
huet committed
477 478 479 480 481
	echo "Version $(VERSION) of Sanskrit site released on $(SERVERHOST)"


# if one does not rebuild morphologic resources with make scratch, this will
# just release the new software on the old data - convenient for debug/test.
482 483
releasecgi:
	mkdir -p $(CGIDIR)
huet's avatar
huet committed
484 485 486 487 488
	$(MAKE) grammar
	$(MAKE) indexers
	$(MAKE) stemmer
	$(MAKE) analyser
	$(MAKE) sandhi
489
	$(MAKE) manager
Idir Lankri's avatar
Idir Lankri committed
490
	$(MAKE) addcorpus
huet's avatar
huet committed
491 492 493 494

abrevs:
	cp $(BOOK)/abrevs.pdf SITE # for documenting the Website with abbreviations

495
# This releases on the server the new lexical data base and Web resources
huet's avatar
huet committed
496
# must be done after releaseMW for links adjustments
497
releasedata: abrevs
huet's avatar
huet committed
498 499
	cp $(WEBSOURCES) $(SERVERPUBLICDIR)
	cp $(SITEPAGES) $(SERVERPUBLICDIR) # site main pages made by configure
500
#	cp $(GOLDENDICT) $(SERVERPUBLICDIR) # Goldendict version now separated
501 502 503 504 505
	if [ "$(LEXICON)" = "SH" ]; then			\
		cp $(SITEPAGE_FR) $(SERVERPUBLICDIR)index.html;	\
	else							\
		cp $(SITEPAGE_EN) $(SERVERPUBLICDIR)index.html;	\
	fi # default language from lexicon parameter
huet's avatar
huet committed
506
	cp -R $(DICO) $(SERVERPUBLICDIR) # hypertext Heritage dictionary
507 508 509 510
	if [ $(SKTCORPUS) ]; then			\
		cp -R $(SKTCORPUS) $(SERVERCORPUS);	\
		chown -R www-data $(SERVERCORPUS);	\
	fi			# Sanskrit corpus
huet's avatar
huet committed
511 512 513 514 515 516 517 518 519 520 521 522 523
# so that cgis invocations in DICO pages are relocated consistently with config:
	cd $(SERVERPUBLICDIR) && for i in `ls DICO/*.html`; do (\
sed '1,$$s|!CGIDECL|$(CGIBINURL)$(CGIDECL)|g' < $$i >temp; \
sed '1,$$s|!CGICONJ|$(CGIBINURL)$(CGICONJ)|g' < temp >$$i; \
rm temp ); done
# more relocation for MW, waiting for better solution
	cd $(SERVERPUBLICDIR) && for i in `ls MW/*.html`; do (\
sed '1,$$s|!CGIDECL|$(CGIBINURL)$(CGIDECL)|g' < $$i >temp; \
sed '1,$$s|!CGICONJ|$(CGIBINURL)$(CGICONJ)|g' < temp >$$i; \
rm temp ); done
	cp $(AUTOMATA) $(SERVERPUBLICDIR)DATA # Sanskrit Engine data
	cp $(DATAMW) $(SERVERPUBLICDIR)DATA # MW links
	cp $(SCRIPTS) $(SERVERPUBLICDIR)DICO # Javascript in DICO dir
524
#	cp $(DOC_IMAGES) $(SERVERPUBLICDIR)IMAGES
huet's avatar
huet committed
525 526 527

BOOKPRINTS=$(BOOK)/Heritage.pdf $(BOOK)/abrevs.pdf

528
releasebook:
529 530 531
	cp $(BOOKPRINTS) $(SERVERPUBLICDIR)

releasexml: # Sanskrit morphology in xml copied from Resources to Server
532
# This should be deprecated soon, and XML banks released separately 
533 534 535 536 537 538
	mkdir -p $(SERVERPUBLICDIR)$(DATA)/XML
	cp $(XML_MORPHOLOGY) $(SERVERPUBLICDIR)$(DATA)/XML

releasepdf: pdfmorphology # very big - useless
	cp $(PDF_MORPHOLOGY) $(SERVERPUBLICDIR)$(DATA)

539
releaseMW:
huet's avatar
huet committed
540 541
	cp -Rp $(MW) $(SERVERPUBLICDIR) # MW pages linked to decl/conjug cgis

542
releasedoc:
huet's avatar
huet committed
543 544 545 546
	cp $(PORTALPAGES) $(SERVERPUBLICDIR) # portal pages made by configure
	cp $(PORTALPAGE_FR) $(SERVERPUBLICDIR)portal.html # compatibility default
	cp $(FAQPAGES) $(SERVERPUBLICDIR) # faq pages made by configure
	cp $(FAQPAGE_FR) $(SERVERPUBLICDIR)faq.html # compatibility default fr
547
	cp $(MANUAL) $(SERVERPUBLICDIR) # user's manual
huet's avatar
huet committed
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
#	cp $(ROBOTS) $(SERVERPUBLICDIR) # robots permissions
	cp $(GOLD) $(SERVERPUBLICDIR) # Heritage's Hall of Fame
	cp $(DOC_ML) $(SERVERPUBLICDIR)DOC
	cp -p DOC/transliterations.pdf $(SERVERPUBLICDIR)DOC

grammar: ML/declension ML/conjugation
	cp ML/declension $(CGIDIR)$(CGIDECL)
	cp ML/conjugation $(CGIDIR)$(CGICONJ)

stemmer: ML/lemmatizer
	cp ML/lemmatizer $(CGIDIR)$(CGILEMMA)

sandhi: ML/sandhier
	cp ML/sandhier $(CGIDIR)$(CGISANDHI)

563 564 565 566 567 568 569 570
analyser: ML/reader ML/parser ML/interface ML/user_aid
#	cp ML/reader1cgi $(CGIDIR)$(CGIREADER)
	cp ML/reader $(CGIDIR)$(CGIREADER)
	cp ML/parser $(CGIDIR)$(CGIPARSER)
	cp ML/interface $(CGIDIR)$(CGIGRAPH)
	cp ML/user_aid $(CGIDIR)$(CGIUSER)
	cp ML/mk_reader_page $(CGIDIR)skt_heritage # $(CGIINTERFACE)
#	cp ML/tagger $(CGIDIR)$(CGITAGGER)
huet's avatar
huet committed
571 572 573 574 575

indexers: ML/indexer ML/indexerd
	cp ML/indexer $(CGIDIR)$(CGIINDEX)
	cp ML/indexerd $(CGIDIR)$(CGIINDEXD)

576 577 578 579
.PHONY: manager
manager: ML/manager
	cp $< $(CGIDIR)$(CGIMANAGER)

Idir Lankri's avatar
Idir Lankri committed
580 581 582 583
.PHONY: addcorpus
addcorpus: ML/add_corpus
	cp $< $(CGIDIR)$(CGIADDCORPUS)

584 585
#### Version Management and Distribution are now managed by Git ####

huet's avatar
huet committed
586
##############################
587
####  Version Management  #### Obsolete
huet's avatar
huet committed
588 589
##############################

590
# For release of Heritage_Platform, make distrib_platform
huet's avatar
huet committed
591 592 593 594

# next operations to perform on http server platform for site update
platform_unload: SktPlatform.$(VERSION).tar.gz
	gunzip SktPlatform.$(VERSION).tar.gz
595
	tar xvf SktPlatform.$(VERSION).tar
huet's avatar
huet committed
596

597
software_doc: # needs to have ocamlweb installed
huet's avatar
huet committed
598 599 600
	cd ML && $(MAKE) doc

########################
601
####  Distribution  #### Obsolete
huet's avatar
huet committed
602 603 604 605
########################

# customise LICENSEs above before distributing
# Directory DISTR should not exist for next 4 scripts
606 607
# Note cp -p used instead of tar for incrementality
distr_engine:  # distribution of packages CORE GRAM abd WEB under SOFT_LICENSE
huet's avatar
huet committed
608
	rm -rf DISTR
609
	cd $(STAT); cat stats.txt >> distribs # recording of statistics
huet's avatar
huet committed
610 611 612
	mkdir DISTR                # Distribution directory
	mkdir DISTR/ML             # Source code library for all packages
	mkdir DISTR/SETUP          # SETUP directory
Gérard Huet's avatar
Gérard Huet committed
613
	mkdir DISTR/JAVASCRIPT     # JAVASCRIPT scripts directory
huet's avatar
huet committed
614 615 616 617
	cp -p $(UTIL) DISTR/ML     # Skt script utilities
	cp -p $(DISTR_CORE) DISTR/ML     # Skt Core Engine ML source code
	cp -p $(GRAM) DISTR/ML     # Skt Grammatical Engine ML source code
	cp -p $(WEB) DISTR/ML      # Skt Site Manager ML source code
618
	cp -p $(AUT) DISTR/ML      # Skt Automaton production source code
Gérard Huet's avatar
Gérard Huet committed
619
	cp -p $(SCRIPTS) DISTR/JAVASCRIPT # Scripts
620
	cp -Rp $(SYSTEM_SETUP) DISTR/SETUP  # SETUP
huet's avatar
huet committed
621
	cp -p $(SYSTEM_configure) DISTR # configure at top level
622
#	cp -Rp $(SYSTEM_supplements) DISTR/SETUP  # supplements
huet's avatar
huet committed
623 624
	cp -p $(INFOS) DISTR # installation instructions, scripts
	cp -p $(SOFT_LICENSE) DISTR/ML/LICENSE # customised software license
625
	mkdir DISTR/SITE           # For Skt Platform portal
huet's avatar
huet committed
626 627 628 629 630 631 632 633 634 635 636 637
	cp -p $(WEBSOURCES) DISTR/SITE       # Skt site entry page
#	cp -p $(ZENSITESOURCE) DISTR/SITE/ZEN  # Zen site entry page
	cp -p $(SITESOURCE) DISTR/SITE
#	cp -p $(GOLDENDICT) DISTR/SITE # enormous - separately distributed
	mkdir DISTR/IMAGES         # For Web site images
	cp -Rp $(IMAGES) DISTR/IMAGES # Web site images
	cp -Rp MW DISTR            # Hypertext Monier Williams with grammar links
#	mkdir DISTR/FONTS          # Fonts mirroring
#	cp -p $(FONTS) DISTR/FONTS # Fonts

distr_automata: # distribution of data derived from Heritage Dictionary
	$(MAKE) distr_engine
638
	mkdir -p DISTR/$(DATA)            # Linguistic data and derived automata
huet's avatar
huet committed
639
	mkdir -p DISTR/$(DATA)/XML        # Linguistic data in XML - empty now
640
	cp -p $(DATA)/XML/*.gz $(DATA)/XML/index.html DISTR/$(DATA)/XML
huet's avatar
huet committed
641 642
	cp -p $(DATA_LICENSE) DISTR/$(DATA_LICENSE) # customised data license
	cp -p $(XMLDATA)/SL_morph.dtd $(XMLDATA)/WX_morph.dtd DISTR/$(DATA)/XML
643
	cp -p $(AUTOMATA) DISTR/$(DATA)   # Data for Skt_Platform cgi executables
huet's avatar
huet committed
644 645 646 647 648 649
	cp -p $(DATAMW) DISTR/$(DATA) # MW alignment
#	touch DISTR/automata   # for make automata to succeed vacuously

distrib: # distribution of ZEN, and of derived Heritage under HTML & PDF formats
	$(MAKE) distr_automata
	cp -p SETUP/zen.tar DISTR/SETUP # Zen toolkit distribution included
650
# DICO is assumed to be customized for the distribution site
huet's avatar
huet committed
651 652 653 654
	cp -Rp $(DICO) DISTR     # Hypertext Heritage Dictionary for browsing
	mkdir DISTR/BOOK
	cp -p $(BOOKPRINTS) DISTR/BOOK # Heritage Skt Dictionary for printing
	mkdir DISTR/DOC
655 656
	cd ML; $(MAKE) doc
	cp -p DOC/Heritage_platform.pdf DISTR/DOC
657 658
	cp -p DOC/transliterations.pdf DISTR/DOC
	cp -p $(MANUAL) DISTR/SITE # user's manual
huet's avatar
huet committed
659 660
#	cp -p $(ROBOTS) DISTR/SITE # robots permissions
	mkdir DISTR/$(STAT)
661 662 663
#	cp -p $(STAT)/regression_template DISTR/$(STAT) # for regression analysis suite
#	touch DISTR/dictionary # for make dictionary to succeed vacuously
#	touch DISTR/xmlmorphology # for make xmlmorphology to succeed vacuously
huet's avatar
huet committed
664 665 666 667 668 669

# creates an archive SktPlatform.$(VERSION) with the full distribution (55Mb)
distrib_full: distrib# assumes distrib has been run, and thus directory DISTR exists
	test -e DISTR || (echo "DISTR inexistant"; exit 1)
	test -e SktPlatform.$(VERSION) && echo "Distribution dir exists" \
&& exit 1 || echo "OK"
670
	cd DISTR && mkdir $(DATA)/ML
huet's avatar
huet committed
671 672 673 674
	cp -p DOC/doc.pdf DISTR/DOC       # Skt Platform pdf documentation
	cp -p $(DOCS) DISTR/DOC           # Various documentation and articles
	cp -p $(DIC) DISTR                # Sanskrit Heritage Dictionary source
	cp -p $(LEX) DISTR/ML             # Skt Engine Compiling ML source code
675
	cp -p $(AUT) DISTR/ML             # Skt Automaton
huet's avatar
huet committed
676 677 678 679 680 681 682 683 684 685
	cp -p $(AUT1) DISTR/ML            # Skt Automaton experimental
	cp -p $(TREE) DISTR/ML            # Skt Treebank and Syntax manager
	cp -p $(DEBUG) DISTR/ML           # Debugging tools
	cp -p $(BOOKSOURCE) DISTR/BOOK    # Book introduction
	cp -Rp $(DOCSOURCE) DISTR/DOC     # Software documentation source
	cp -p $(SITESOURCE) $(WEBSOURCES) DISTR/SITE # Web pages
#	cp  $(PDF_MORPHOLOGY) DISTR/$(DATA) # Skt PDF Morphology very big
	cp -Rp $(DATASOURCE) DISTR/$(DATA) # Morphology introduction
	cp -Rp CORPUS DISTR # Corpus - under development
	cp -Rp $(STAT) DISTR              # Statistical data, logs, notes
686
#	touch DISTR/dictionary # for make dictionary to succeed vacuously
huet's avatar
huet committed
687 688
	mv DISTR SktPlatform.$(VERSION)   # SktPlatform.$(VERSION) fresh

689
# deprecated: now we may use Git for distribution
huet's avatar
huet committed
690
distrib_platform: distrib_full # create distribution tar file of full SktPlatform
691 692
	tar czvf SktPlatform.$(VERSION).tar.gz SktPlatform.$(VERSION)
	rm -rf SktPlatform.$(VERSION)
huet's avatar
huet committed
693

694
depot: # depot ANL - only SktPlatform, no linguistic data
huet's avatar
huet committed
695 696 697 698 699 700 701
	mkdir DISTR                # Distribution directory
	mkdir DISTR/ML             # Source code library for all packages
	mkdir DISTR/SETUP          # SETUP dir
	cp $(UTIL) DISTR/ML        # Skt script utilities
	cp $(CORE) DISTR/ML        # Skt Core Engine ML source code
	cp $(GRAM) DISTR/ML        # Skt Grammatical Engine ML source code
	cp $(WEB) DISTR/ML         # Skt Site Manager ML source code
702
	cp -Rp $(SYSTEM_SETUP) DISTR/SETUP  # SETUP
huet's avatar
huet committed
703 704 705
	cp -p $(SYSTEM_configure) DISTR # configure at top level
	cp $(INFOS) DISTR          # installation instructions, scripts
	cp $(SOFT_LICENSE) DISTR/ML/LICENSE # customised software license
706
	mkdir DISTR/DOC
huet's avatar
huet committed
707 708 709 710
	cp -p DOC/doc.pdf DISTR/DOC       # Skt Engine pdf documentation
	cp -p $(DOCS) DISTR/DOC           # Various documentation and articles
	cp -p $(LEX) DISTR/ML             # Skt Engine Compiling ML source code
	cp -p $(TREE) DISTR/ML            # Skt Treebank and Syntax manager
711
	mv DISTR SktPlatform_$(VERSION)     # Skt_Platform distribution
huet's avatar
huet committed
712 713

install: #after distribution to host site: "./configure; make; sudo make install"
714
	SETUP/issudo.sh
715
	test -f $(SERVERPUBLICDIR)DATA/cache.txt && echo "cold install" || $(MAKE) cold
huet's avatar
huet committed
716 717 718 719 720 721
	test -f $(SERVERPUBLICDIR)$(VAR)/regression.txt && echo "regression install" || $(MAKE) install_regression
	$(MAKE) release

# for first installation, do "sudo make cold" before "make install"
cold: # for first install
	mkdir -p $(SERVERPUBLICDIR)IMAGES
722
	mkdir -p $(SERVERPUBLICDIR)DATA
huet's avatar
huet committed
723
	mkdir -p $(SERVERPUBLICDIR)DOC
724 725 726
	cd $(SERVERPUBLICDIR)DATA; touch $(CACHES); chmod a+w $(CACHES)
	cp -R $(IMAGES) $(SERVERPUBLICDIR)IMAGES
	cp -p $(SCRIPTS) $(SERVERPUBLICDIR)
huet's avatar
huet committed
727 728 729 730 731 732
	$(MAKE) empty_caches
#	$(MAKE) install_counter # only for master site migration

install_regression: # for initialisation of regression suite - su privilege
	mkdir -p $(SERVERPUBLICDIR)$(VAR)
	chmod a+rw $(SERVERPUBLICDIR)$(VAR)
733
#TODO	cp -p $(STAT)/regression_template $(SERVERPUBLICDIR)$(VAR)/regression.txt
734
#TODO	chmod a+rw $(SERVERPUBLICDIR)$(VAR)/regression.txt
huet's avatar
huet committed
735 736 737 738 739 740 741 742 743 744 745 746 747

empty_caches: ML/reset_caches # caution: will reset the caches
	ML/reset_caches

# reserved for master site
install_counter: counter
	cp -f SETUP/wwwcount2.5/bin/Count.cgi $(CGIDIR)
	mkdir -p $(SERVERPUBLICDIR)Counter/conf/
	cp -f SETUP/wwwcount2.5/count.cfg $(SERVERPUBLICDIR)Counter/conf
	rm -rf SETUP/wwwcount2.5

# Update of Amrita site page - reserved to webmaster
amrita_sitepage:
748
	cd /Library/WebServer/Documents/index.html.fr && cp -p SITE/amrita_server.index.html.fr index.html.fr
huet's avatar
huet committed
749 750 751 752 753 754

counter:
	cd SETUP && tar xzvf wwwcount2.5.tar.gz
	cd SETUP && ./counter.py
	cd SETUP/wwwcount2.5 && ./configure
	cd SETUP/wwwcount2.5 && make all