MMakefile 30.4 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 36
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

# Virtual path for make
37
VPATH=ML
huet's avatar
huet committed
38 39 40 41 42 43 44

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

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

45
# Distribution licenses - depends on the packages selection
huet's avatar
huet committed
46 47 48
# LGPL distribution Kerala workshop 25-12-2011 Happy Christmas !
# LGPL distribution WSC Conference Bangkok 25-06-2015
# GitLab archive 15-04-2017
49
# SCL parser interface 02-06-2017
huet's avatar
huet committed
50 51 52

SOFT_LICENSE=LEGAL/LGPL/LICENSE # Free software license LGPL
#SOFT_LICENSE=LEGAL/UoH/LICENSE # University of Hyderabad distribution
53
DATA_LICENSE=$(DATA)/LGPLLR.pdf
huet's avatar
huet committed
54 55 56 57
DATA_LICENSES=$(DATA)/LGPLLR.pdf $(DATA)/LGPLLR.tex $(DATA)/LGPLLR.html
LICENSES=$(SOFT_LICENSE) $(DATA_LICENSE)

ML_COPYRIGHT=ML/COPYRIGHT
58
LEGAL=$(ML_COPYRIGHT) $(LICENSES)
huet's avatar
huet committed
59 60 61 62 63 64 65 66 67 68 69 70 71

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
72 73
INRIA_IMAGES=IMAGES/icon_ocaml.png IMAGES/JoeCaml.png \
IMAGES/logo_inria.png # Copyright Inria
huet's avatar
huet committed
74 75 76 77 78 79 80 81 82 83 84 85
# 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
86
SCRIPTS=JAVASCRIPT/utf82VH.js JAVASCRIPT/dragtable.js
huet's avatar
huet committed
87

88
# Next are copyright specific images
huet's avatar
huet committed
89
SITE_IMAGES=IMAGES/yinyang.gif IMAGES/panini.jpg IMAGES/spin-new.gif \
90 91 92
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
93 94 95 96 97 98
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

99
# Distributed images for mirror Web site
huet's avatar
huet committed
100 101 102 103 104 105 106 107 108
#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

109
# Lexical databases
huet's avatar
huet committed
110 111 112 113 114 115 116 117 118 119 120 121 122
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
123
LEXICON=#LEXICON# Lexicon toggle default
huet's avatar
huet committed
124 125 126
DISPLAY=#DISPLAY# Default display font deva or roma

# Main directory, where the sanskrit tools are installed
127
SKTINSTALLDIR=#SKTINSTALLDIR# To be set at configuration time
huet's avatar
huet committed
128 129 130 131

# Host name of the server - used only for installation message below
SERVERHOST=#SERVERHOST
# SERVERHOST=sanskrit.inria.fr# quincy sanskrit [official site]
132
# SERVERHOST=pauillac.inria.fr# pauillac
huet's avatar
huet committed
133
# SERVERHOST=213.41.153.152# dhruva gerardh.net1.nerim.net [legacy]
134 135 136

# For remote invocation of cgi services (eg Sanskrit Library)
REMOTESERVERHOST=http://sanskrit.inria.fr/# remote host Inria
huet's avatar
huet committed
137 138 139 140 141 142 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

# 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 *)
176
CGITAGGER=skttagger$(CGIEXT)
huet's avatar
huet committed
177 178 179 180 181 182
# 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)
183 184 185
# CGI name under which the corpus manager is installed on the server.
CGIMANAGER = manager$(CGIEXT)

huet's avatar
huet committed
186 187 188 189 190 191 192 193 194
# 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]

195
# Customisation of SCL platform interface - under rehaul
huet's avatar
huet committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
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
211
# WEB is needed to create the web pages and cgi-bin executables
huet's avatar
huet committed
212

213
# Les packages de modules - Tous dans la bibliothèque ML
huet's avatar
huet committed
214 215 216
# Linked to the ZEN library (generic Ocaml computational linguistic library)

# UTIL utilities for ML folder
217
UTIL=ML/Makefile $(ML_COPYRIGHT) ML/.ocamlinit ML/.depend
huet's avatar
huet committed
218 219 220 221

# 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 \
222 223
ML/sanskrit.mli ML/sanskrit.ml ML/french.mli ML/french.ml ML/skt_lexer.ml \
ML/dir.mli ML/dir.ml
224
CORE=$(DISTR_CORE) ML/paths.ml
huet's avatar
huet committed
225 226 227 228 229 230 231 232 233

# 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 \
234
ML/rank.ml ML/scl_parser.ml ML/reader.ml ML/parser.ml ML/constraints.mli \
huet's avatar
huet committed
235
ML/constraints.ml ML/multilingual.ml ML/paraphrase.mli ML/paraphrase.ml \
236
ML/bank_lexer.ml ML/regression.ml ML/checkpoints.ml \
huet's avatar
huet committed
237
ML/graph_segmenter.ml ML/interface.mli ML/interface.ml ML/user_aid.ml \
238
ML/reset_caches.ml
huet's avatar
huet committed
239 240 241 242

# 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 \
243
ML/mk_sandhi_page.ml ML/morpho_scl.ml ML/compute_mw_links.ml ML/manager.ml
huet's avatar
huet committed
244 245 246

# 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 \
247
ML/tag_apte.ml
huet's avatar
huet committed
248

249
DEBUG= ML/morpho_debug.ml ML/debug.ml
huet's avatar
huet committed
250

251
# Historical versions of the segmenter, tagger and reader with single phase
huet's avatar
huet committed
252 253 254 255 256
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)
257
ML=$(UTIL) $(CORE) $(GRAM) $(WEB) $(TREE) $(LEGAL)
huet's avatar
huet committed
258 259 260 261 262 263 264 265

# 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

266 267
# System documentation
DOC=DOC/doc.ps DOC/doc.html DOC/doc.pdf
huet's avatar
huet committed
268 269 270 271 272 273
# 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
274
SITEPAGES=$(SITEPAGE_FR) $(SITEPAGE_EN)
huet's avatar
huet committed
275 276
PORTALPAGE_FR=SITE/portal.fr.html
PORTALPAGE_EN=SITE/portal.en.html
277
PORTALPAGES=$(PORTALPAGE_FR) $(PORTALPAGE_EN)
huet's avatar
huet committed
278 279
FAQPAGE_FR=SITE/faq.fr.html
FAQPAGE_EN=SITE/faq.en.html
280
FAQPAGES=$(FAQPAGE_FR) $(FAQPAGE_EN)
huet's avatar
huet committed
281
MANUAL=SITE/manual.html
Gérard Huet's avatar
Gérard Huet committed
282 283 284
XMLPAGE=SITE/xml.html
FAQ=SITE/faq.html
PORTAL=SITE/portal.html
huet's avatar
huet committed
285
GOLD=SITE/gold.html
Gérard Huet's avatar
Gérard Huet committed
286 287 288
GOLDEN=SITE/goldendict.html
ABREVS=SITE/abrevs.pdf
ROBOTS=SITE/robots.txt # currently disabled to allow Google access
huet's avatar
huet committed
289

290 291 292
# 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

293
WEBSOURCES=$(PORTAL) $(FAQ) $(ABREVS) $(GOLD) $(GOLDEN) $(MANUAL) $(XMLPAGE)
294
ALLWEBSOURCES=$(SITESOURCE) $(WEBSOURCES)
huet's avatar
huet committed
295 296 297 298 299 300
# 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 \
301 302 303
$(DATA_LICENSES) $(DATA)/Makefile
# All data sources
SOURCE=$(DOCSOURCE) $(DATASOURCE) $(ALLWEBSOURCES)
huet's avatar
huet committed
304

305 306
# Miscellaneous documentation
OBSOLETE_DOCS=DOC/sanskrit.pdf
huet's avatar
huet committed
307
DOCS=DOC/sanskrit.pdf DOC/wsc.pdf DOC/tagger.pdf DOC/wcre.pdf DOC/coling.pdf \
308
DOC/Mumbai.pdf DOC/Brown.pdf DOC/IWRIDL.pdf DOC/COLING_2012.pdf DOC/WSC13.pdf
huet's avatar
huet committed
309
DOC_ML=DOC/Heritage_Platform.pdf
310
# Automata databases for use by the Sanskrit Engine
huet's avatar
huet committed
311 312 313 314 315 316

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 \
317 318 319
$(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
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
$(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
336
# roots_usage.rem is used at run time by Dispatcher.validate
huet's avatar
huet committed
337 338
# sandhis_id.rem is used at run time by Segmenter
# lexical_kridantas.rem is used at run time by the loading of inflected.cmx
339
# by cgis declension and conjugation
huet's avatar
huet committed
340

341 342
# Persistent Ocaml values files stored in DICO dir for indexing purposes
DICOREMS=entries.rem defs.rem dummies.rem
huet's avatar
huet committed
343 344 345 346 347 348 349 350
# 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

351 352 353
PDF_MORPHOLOGY=$(DATA)/nouns.pdf $(DATA)/roots.pdf $(DATA)/parts.pdf \
$(DATA)/indecls.pdf $(DATA)/final.pdf # enormous, useless

huet's avatar
huet committed
354 355 356 357 358
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)

359
# Various test examples
huet's avatar
huet committed
360 361 362 363 364 365 366
# CORPUS=CORPUS/APTE CORPUS/Baladarza CORPUS/NN CORPUS/S_Raama CORPUS/REGRESSION

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

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

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

386
# After updating installation parameters above, the python script configure
387
# regenerates Makefile from SETUP/MMakefile and executes "make configuration"
388
configuration:
huet's avatar
huet committed
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
	(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)"'; \
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)"'; \
413
echo 'and cgi_manager = "$(CGIMANAGER)"'; \
414
echo 'and mouse_action = "$(MOUSEACTION)";') > ML/paths.ml
huet's avatar
huet committed
415 416 417 418 419 420 421 422 423 424 425 426
	$(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

427
supplements:
huet's avatar
huet committed
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
	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
451

huet's avatar
huet committed
452
## Following entry points make partial update/installation on the local server
453
## they need su privilege for writing in the server area
huet's avatar
huet committed
454 455 456 457

# 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
458
	cd ML && $(MAKE) cgis site_pages
Gérard Huet's avatar
Gérard Huet committed
459
	cp -p SITE/xml.html DICO
huet's avatar
huet committed
460

461
release: $(DICO) web_services releasecgi releaseMW releasedata releasedoc \
Gérard Huet's avatar
Gérard Huet committed
462 463
releasebook
# releasexml - no XML release on server - lookup Heritage_Resources
464
# releasepdf disabled at present as bulky and un-finished
huet's avatar
huet committed
465 466 467 468 469
	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.
470 471
releasecgi:
	mkdir -p $(CGIDIR)
huet's avatar
huet committed
472 473 474 475 476
	$(MAKE) grammar
	$(MAKE) indexers
	$(MAKE) stemmer
	$(MAKE) analyser
	$(MAKE) sandhi
477
	$(MAKE) manager
huet's avatar
huet committed
478 479 480 481

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

482
# This releases on the server the new lexical data base and Web resources
huet's avatar
huet committed
483
# must be done after releaseMW for links adjustments
484
releasedata: abrevs
huet's avatar
huet committed
485 486
	cp $(WEBSOURCES) $(SERVERPUBLICDIR)
	cp $(SITEPAGES) $(SERVERPUBLICDIR) # site main pages made by configure
487
#	cp $(GOLDENDICT) $(SERVERPUBLICDIR) # Goldendict version now separated
488 489 490 491 492
	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
493 494 495 496 497 498 499 500 501 502 503 504 505 506
	cp -R $(DICO) $(SERVERPUBLICDIR) # hypertext Heritage dictionary
# 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
507
#	cp $(DOC_IMAGES) $(SERVERPUBLICDIR)IMAGES
huet's avatar
huet committed
508 509 510

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

511
releasebook:
512 513 514
	cp $(BOOKPRINTS) $(SERVERPUBLICDIR)

releasexml: # Sanskrit morphology in xml copied from Resources to Server
515
# This should be deprecated soon, and XML banks released separately 
516 517 518 519 520 521
	mkdir -p $(SERVERPUBLICDIR)$(DATA)/XML
	cp $(XML_MORPHOLOGY) $(SERVERPUBLICDIR)$(DATA)/XML

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

522
releaseMW:
huet's avatar
huet committed
523 524
	cp -Rp $(MW) $(SERVERPUBLICDIR) # MW pages linked to decl/conjug cgis

525
releasedoc:
huet's avatar
huet committed
526 527 528 529
	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
530
	cp $(MANUAL) $(SERVERPUBLICDIR) # user's manual
huet's avatar
huet committed
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
#	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)

546 547 548 549 550 551 552 553
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
554 555 556 557 558

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

559 560 561 562
.PHONY: manager
manager: ML/manager
	cp $< $(CGIDIR)$(CGIMANAGER)

563 564
#### Version Management and Distribution are now managed by Git ####

huet's avatar
huet committed
565
##############################
566
####  Version Management  #### Obsolete
huet's avatar
huet committed
567 568
##############################

569
# For release of Heritage_Platform, make distrib_platform
huet's avatar
huet committed
570 571 572 573

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

576
software_doc: # needs to have ocamlweb installed
huet's avatar
huet committed
577 578 579
	cd ML && $(MAKE) doc

########################
580
####  Distribution  #### Obsolete
huet's avatar
huet committed
581 582 583 584
########################

# customise LICENSEs above before distributing
# Directory DISTR should not exist for next 4 scripts
585 586
# 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
587
	rm -rf DISTR
588
	cd $(STAT); cat stats.txt >> distribs # recording of statistics
huet's avatar
huet committed
589 590 591
	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
592
	mkdir DISTR/JAVASCRIPT     # JAVASCRIPT scripts directory
huet's avatar
huet committed
593 594 595 596
	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
597
	cp -p $(AUT) DISTR/ML      # Skt Automaton production source code
Gérard Huet's avatar
Gérard Huet committed
598
	cp -p $(SCRIPTS) DISTR/JAVASCRIPT # Scripts
599
	cp -Rp $(SYSTEM_SETUP) DISTR/SETUP  # SETUP
huet's avatar
huet committed
600
	cp -p $(SYSTEM_configure) DISTR # configure at top level
601
#	cp -Rp $(SYSTEM_supplements) DISTR/SETUP  # supplements
huet's avatar
huet committed
602 603
	cp -p $(INFOS) DISTR # installation instructions, scripts
	cp -p $(SOFT_LICENSE) DISTR/ML/LICENSE # customised software license
604
	mkdir DISTR/SITE           # For Skt Platform portal
huet's avatar
huet committed
605 606 607 608 609 610 611 612 613 614 615 616
	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
617
	mkdir -p DISTR/$(DATA)            # Linguistic data and derived automata
huet's avatar
huet committed
618
	mkdir -p DISTR/$(DATA)/XML        # Linguistic data in XML - empty now
619
	cp -p $(DATA)/XML/*.gz $(DATA)/XML/index.html DISTR/$(DATA)/XML
huet's avatar
huet committed
620 621
	cp -p $(DATA_LICENSE) DISTR/$(DATA_LICENSE) # customised data license
	cp -p $(XMLDATA)/SL_morph.dtd $(XMLDATA)/WX_morph.dtd DISTR/$(DATA)/XML
622
	cp -p $(AUTOMATA) DISTR/$(DATA)   # Data for Skt_Platform cgi executables
huet's avatar
huet committed
623 624 625 626 627 628
	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
629
# DICO is assumed to be customized for the distribution site
huet's avatar
huet committed
630 631 632 633
	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
634 635
	cd ML; $(MAKE) doc
	cp -p DOC/Heritage_platform.pdf DISTR/DOC
636 637
	cp -p DOC/transliterations.pdf DISTR/DOC
	cp -p $(MANUAL) DISTR/SITE # user's manual
huet's avatar
huet committed
638 639
#	cp -p $(ROBOTS) DISTR/SITE # robots permissions
	mkdir DISTR/$(STAT)
640 641 642
#	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
643 644 645 646 647 648

# 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"
649
	cd DISTR && mkdir $(DATA)/ML
huet's avatar
huet committed
650 651 652 653
	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
654
	cp -p $(AUT) DISTR/ML             # Skt Automaton
huet's avatar
huet committed
655 656 657 658 659 660 661 662 663 664
	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
665
#	touch DISTR/dictionary # for make dictionary to succeed vacuously
huet's avatar
huet committed
666 667
	mv DISTR SktPlatform.$(VERSION)   # SktPlatform.$(VERSION) fresh

668
# deprecated: now we may use Git for distribution
huet's avatar
huet committed
669
distrib_platform: distrib_full # create distribution tar file of full SktPlatform
670 671
	tar czvf SktPlatform.$(VERSION).tar.gz SktPlatform.$(VERSION)
	rm -rf SktPlatform.$(VERSION)
huet's avatar
huet committed
672

673
depot: # depot ANL - only SktPlatform, no linguistic data
huet's avatar
huet committed
674 675 676 677 678 679 680
	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
681
	cp -Rp $(SYSTEM_SETUP) DISTR/SETUP  # SETUP
huet's avatar
huet committed
682 683 684
	cp -p $(SYSTEM_configure) DISTR # configure at top level
	cp $(INFOS) DISTR          # installation instructions, scripts
	cp $(SOFT_LICENSE) DISTR/ML/LICENSE # customised software license
685
	mkdir DISTR/DOC
huet's avatar
huet committed
686 687 688 689
	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
690
	mv DISTR SktPlatform_$(VERSION)     # Skt_Platform distribution
huet's avatar
huet committed
691 692

install: #after distribution to host site: "./configure; make; sudo make install"
693
	SETUP/issudo.sh
694
	test -f $(SERVERPUBLICDIR)DATA/cache.txt && echo "cold install" || $(MAKE) cold
huet's avatar
huet committed
695 696 697 698 699 700
	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
701
	mkdir -p $(SERVERPUBLICDIR)DATA
huet's avatar
huet committed
702
	mkdir -p $(SERVERPUBLICDIR)DOC
703 704 705
	cd $(SERVERPUBLICDIR)DATA; touch $(CACHES); chmod a+w $(CACHES)
	cp -R $(IMAGES) $(SERVERPUBLICDIR)IMAGES
	cp -p $(SCRIPTS) $(SERVERPUBLICDIR)
huet's avatar
huet committed
706 707 708 709 710 711
	$(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)
712
#TODO	cp -p $(STAT)/regression_template $(SERVERPUBLICDIR)$(VAR)/regression.txt
713
#TODO	chmod a+rw $(SERVERPUBLICDIR)$(VAR)/regression.txt
huet's avatar
huet committed
714 715 716 717 718 719 720 721 722 723 724 725 726

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:
727
	cd /Library/WebServer/Documents/index.html.fr && cp -p SITE/amrita_server.index.html.fr index.html.fr
huet's avatar
huet committed
728 729 730 731 732 733

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