utt/app/Makefile
pawelk 52bccead73 Pierwszy etap zmiany con na kon (przez windowsa).
git-svn-id: svn://atos.wmid.amu.edu.pl/utt@6 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
2008-03-12 07:46:53 +00:00

153 lines
3.8 KiB
Makefile

# main makefile
BIN=bin
SRC=src
DIR=$(shell pwd)
##############################
UTT_DIST_NAME=utt-0.9
export UTT_DIR=${DIR}/${UTT_DIST_NAME}
export UTT_BIN_DIR=${UTT_DIR}/bin # executables
export UTT_CONF_DIR=${UTT_DIR}/conf # configuration files
export UTT_SHARE_DIR=${UTT_DIR}/share # stuff
export UTT_LANG_DIR=${UTT_DIR}/lang # language/encoding specific stuff
export UTT_TAGS_DIR=${UTT_DIR}/tags # tag format specific stuff
#export UTT_LIB_DIR=${UTT_DIR}/lib # nothing
export UTT_DOC_DIR=${UTT_DIR}/doc # documantation
UTT_DIST_FILE=utt
# list of components to be included in the distribution
COMPONENTS = lib gue tok.l cor lem kot sen-l sen-nl ser grp kon fla unfla mar compiledic
##############################
all: dirs components conf doc lang tags files share
@echo "Make completed successfully!"
.PHONY: dirs
dirs:
if [ -d ${UTT_DIR} ]; then rm -r ${UTT_DIR}; fi
mkdir -p ${UTT_DIR}
mkdir -p ${UTT_BIN_DIR}
mkdir -p ${UTT_CONF_DIR}
mkdir -p ${UTT_SHARE_DIR}
mkdir -p ${UTT_LANG_DIR}
mkdir -p ${UTT_TAGS_DIR}
mkdir -p ${UTT_DOC_DIR}
.PHONY: components
components:
@for cmp in $(COMPONENTS); do\
make $$cmp;\
done
${COMPONENTS}:
cd $(SRC)/$@ && make && make copy; cd $(DIR);
.PHONY: conf
conf:
cd $(DIR)/conf && make && make copy ; cd $(DIR)
.PHONY: doc
doc:
cd $(DIR)/doc && make && make copy ; cd $(DIR)
.PHONY: lang
lang:
cd $(DIR)/lang && make && make copy ; cd $(DIR)
.PHONY: tags
tags:
cd $(DIR)/tags && make && make copy ; cd $(DIR)
.PHONY: share
share:
cd $(DIR)/share && make && make copy ; cd $(DIR)
.PHONY: files
files:
cd ${DIR}/files && make && make copy ; cd ${DIR}
clean: clean_components clean_doc clean_dist
@echo "All files cleaned successfully!"
clean_components:
@for cmp in $(COMPONENTS); do \
cd $(SRC)/$$cmp && make clean ; cd $(DIR); \
done
clean_lib:
cd $(SRC)/lib && make clean
clean_doc:
cd $(DIR)/doc && make clean ; cd $(DIR)
install: all
cd ${UTT_DIR} && make install; cd ${DIR}
uninstall:
cd ${UTT_DIR} && make uninstall; cd ${DIR}
reinstall:
cd ${UTT_DIR} && make reinstall; cd ${DIR}
# ifdef INSTALL_BIN_DIR
# if [ -d ${INSTALL_BIN_DIR} ]; then true; else mkdir -p ${INSTALL_BIN_DIR}; fi
# cp -r ${UTT_BIN_DIR}/* ${INSTALL_BIN_DIR}/
# endif
# ifdef INSTALL_SHARE_DIR
# if [ -d ${INSTALL_SHARE_DIR} ]; then true; else mkdir -p ${INSTALL_SHARE_DIR}; fi
# cp -r ${UTT_SHARE_DIR}/* ${INSTALL_SHARE_DIR}/
# endif
# ifdef INSTALL_DOC_DIR
# if [ -d ${INSTALL_DOC_DIR} ]; then true; else mkdir -p ${INSTALL_DOC_DIR}; fi
# cp -r ${UTT_DOC_DIR}/* ${INSTALL_DOC_DIR}/
# endif
# ifdef INSTALL_LIB_DIR
# if [ -d ${INSTALL_LIB_DIR} ]; then true; else mkdir -p ${INSTALL_LIB_DIR}; fi
# cp -r ${UTT_LIB_DIR}/* ${INSTALL_LIB_DIR}
# endif
#
# install: make_dirs install_components install_cnf install_dta install_doc
# @echo "Installation completed successfully!"
# install_components:
# @for cmp in $(COMPONENTS); do \
# cd $(SRC)/$$cmp && make install ; cd $(DIR); \
# done
# install_cnf:
# cp conf/*.conf $(UTT_ETC_DIR)/
# install_dta:
# cp -r data/* $(UTT_SHARE_DIR)/
# install_doc:
# cp doc/utt.{ps,pdf,html,info} $(UTT_DOC_DIR)/
# make_dirs:
# if [ -d $(UTT_BIN_DIR) ]; then true; else mkdir -p $(UTT_BIN_DIR); fi
# if [ -d $(UTT_ETC_DIR) ]; then true; else mkdir -p $(UTT_ETC_DIR); fi
# if [ -d $(UTT_SHARE_DIR) ]; then true; else mkdir -p $(UTT_SHARE_DIR); fi
# if [ -d $(UTT_DOC_DIR) ]; then true; else mkdir -p $(UTT_DOC_DIR); fi
# if [ -d $(UTT_LIB_DIR) ]; then true; else mkdir -p $(UTT_LIB_DIR); fi
dist: all
tar -czvf $(UTT_DIST_NAME).tgz $(UTT_DIR)
clean_dist:
if [ -d $(UTT_DIST_DIR) ]; then rm -r $(UTT_DIST_DIR); else true; fi
if [ -f $(UTT_DIST_FILE).tar.bz2 ]; then rm $(UTT_DIST_FILE).tar.bz2; else true; fi
if [ -f $(UTT_DIST_PMDB_FILE).tar.bz2 ]; then rm $(UTT_DIST_PMDB_FILE).tar.bz2; else true; fi