utt/app/Makefile
pawelk 8d3e6ab33b Poprawilem wiekszosc makow pod katem poprawego kompilowania.
Wystepuje blad kompilacji dla gue.



git-svn-id: svn://atos.wmid.amu.edu.pl/utt@9 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
2008-03-13 11:45:16 +00:00

128 lines
3.6 KiB
Makefile

# main makefile
# ******************************
# * Local variables
# ******************************
CUR_DIR=$(shell pwd)
SRC_DIR=$(CUR_DIR)/src
OUTPUT_DIR=$(CUR_DIR)/output
# ******************************
# * Global for make globals
# ******************************
export UTT_DIR=${OUTPUT_DIR}
export UTT_BIN_DIR=${UTT_DIR}/bin # executables
export UTT_CONF_DIR=${UTT_DIR}/etc/utt # configuration files
export UTT_LANG_DIR=${UTT_DIR}/share/utt # language/encoding specific stuff
export UTT_LIB_DIR=${UTT_DIR}/lib/utt # some files like ser.l.template, terms.m4
export UTT_SHARE_DIR=${UTT_DIR}/share # stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
##############################
# list of components to be included in the distribution
COMPONENTS = compiledic cor fla gph grp kon kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
# gue nie dziala!
##############################
# ------------------------------------------------------------------
# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR)
# ------------------------------------------------------------------
.PHONY: compile
compile: dirs components
@echo "Make compiled 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_LANG_DIR}
mkdir -p ${UTT_LIB_DIR}
mkdir -p ${UTT_SHARE_DIR}
.PHONY: components
components:
@for cmp in $(COMPONENTS); do\
cd $(SRC_DIR)/$$cmp && make && make copy; cd $(CUR_DIR); \
done
# ------------------------------------------------------------------
# sekcja sprzatania (kasuje binaria z katalogow SRC/COMPONENTS)
# ------------------------------------------------------------------
.PHONY: clean
clean: clean_components clean_doc clean_dist
@echo "All files cleaned successfully!"
.PHONY: clean_components
clean_components:
@for cmp in $(COMPONENTS); do \
cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \
done
cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR);
.PHONY: clean_doc
clean_doc:
cd $(CUR_DIR)/doc && make clean ; cd $(CUR_DIR)
.PHONY: clean_dist
clean_dist:
# ------------------------------------------------------------------
# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
# ------------------------------------------------------------------
.PHONY: build
build: compile build_conf build_lib build_share
@echo "All files builded successfully!"
.PHONY: build_conf
build_conf:
cp $(CUR_DIR)/conf/* $(UTT_CONF_DIR)/
.PHONY: build_lib
build_lib:
cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
.PHONY: build_share
build_share:
@echo "We need to create documentation here!"
# ------------------------------------------------------------------
# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
# ------------------------------------------------------------------
.PHONY: distribute
distribute:
@echo "We need to create distribution here!"
# ------------------------------------------------------------------
# sekcja testowania (kasuje tarballa z TARBALL_TEST_DIR,
# kompiluje, robi paczke,
# tworzy tarballa i wgrywa go do TARBALL_TEST_DIR)
# ------------------------------------------------------------------
#install: all
# cd ${UTT_DIR} && make install; cd ${CUR_DIR}
#uninstall:
# cd ${UTT_DIR} && make uninstall; cd ${DIR}
#reinstall:
# cd ${UTT_DIR} && make reinstall; cd ${DIR}
#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