2008-03-11 14:02:41 +01:00
|
|
|
# main makefile
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ******************************
|
|
|
|
# * Local variables
|
|
|
|
# ******************************
|
|
|
|
CUR_DIR=$(shell pwd)
|
|
|
|
SRC_DIR=$(CUR_DIR)/src
|
|
|
|
OUTPUT_DIR=$(CUR_DIR)/output
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ******************************
|
|
|
|
# * Global for make globals
|
|
|
|
# ******************************
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
export UTT_DIR=${OUTPUT_DIR}
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-17 11:35:12 +01:00
|
|
|
# executables
|
|
|
|
export UTT_BIN_DIR=${UTT_DIR}/bin
|
|
|
|
# configuration files
|
|
|
|
export UTT_CONF_DIR=${UTT_DIR}/etc/utt
|
|
|
|
# language/encoding specific stuff
|
|
|
|
export UTT_LANG_DIR=${UTT_DIR}/share/utt
|
|
|
|
# some files like ser.l.template, terms.m4
|
|
|
|
export UTT_LIB_DIR=${UTT_DIR}/lib/utt
|
|
|
|
# stuff like documantation (man, info), docs: FAQ, COPYRIGHT, NEWS, README
|
|
|
|
export UTT_SHARE_DIR=${UTT_DIR}/share
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
##############################
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
# list of components to be included in the distribution
|
2008-05-07 20:37:46 +02:00
|
|
|
COMPONENTS = compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
|
2008-03-13 12:45:16 +01:00
|
|
|
# gue nie dziala!
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
##############################
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR)
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
.PHONY: compile
|
|
|
|
compile: dirs components
|
|
|
|
@echo "Make compiled successfully!"
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
.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}
|
2008-03-13 12:45:16 +01:00
|
|
|
mkdir -p ${UTT_LIB_DIR}
|
2008-03-17 11:35:12 +01:00
|
|
|
mkdir -p ${UTT_SHARE_DIR}/utt
|
|
|
|
mkdir -p ${UTT_SHARE_DIR}/doc/utt
|
|
|
|
mkdir -p ${UTT_SHARE_DIR}/info
|
|
|
|
mkdir -p ${UTT_SHARE_DIR}/man/man3
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
.PHONY: components
|
|
|
|
components:
|
2008-03-19 12:29:21 +01:00
|
|
|
cd $(SRC_DIR)/lib && make; cd $(CUR_DIR)
|
|
|
|
|
2008-03-11 14:02:41 +01:00
|
|
|
@for cmp in $(COMPONENTS); do\
|
2008-03-13 12:45:16 +01:00
|
|
|
cd $(SRC_DIR)/$$cmp && make && make copy; cd $(CUR_DIR); \
|
2008-03-11 14:02:41 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# sekcja sprzatania (kasuje binaria z katalogow SRC/COMPONENTS)
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
.PHONY: clean
|
2008-03-11 14:02:41 +01:00
|
|
|
clean: clean_components clean_doc clean_dist
|
|
|
|
@echo "All files cleaned successfully!"
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
.PHONY: clean_components
|
2008-03-11 14:02:41 +01:00
|
|
|
clean_components:
|
|
|
|
@for cmp in $(COMPONENTS); do \
|
2008-03-13 12:45:16 +01:00
|
|
|
cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \
|
2008-03-11 14:02:41 +01:00
|
|
|
done
|
2008-03-13 12:45:16 +01:00
|
|
|
cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR);
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
.PHONY: clean_doc
|
2008-03-11 14:02:41 +01:00
|
|
|
clean_doc:
|
2008-03-17 11:35:12 +01:00
|
|
|
cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
|
2008-03-13 12:45:16 +01:00
|
|
|
|
|
|
|
.PHONY: clean_dist
|
|
|
|
clean_dist:
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# sekcja przygotowania paczki (programow wraz z dodatkowymi plikami)
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
.PHONY: build
|
2008-03-17 11:35:12 +01:00
|
|
|
build: compile build_conf build_lib build_doc
|
2008-03-13 12:45:16 +01:00
|
|
|
@echo "All files builded successfully!"
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
.PHONY: build_conf
|
|
|
|
build_conf:
|
2008-03-17 11:35:12 +01:00
|
|
|
cp $(CUR_DIR)/conf/*.conf $(UTT_CONF_DIR)/
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
.PHONY: build_lib
|
|
|
|
build_lib:
|
|
|
|
cp $(CUR_DIR)/lib/* $(UTT_LIB_DIR)/
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-17 11:35:12 +01:00
|
|
|
.PHONY: build_doc
|
|
|
|
build_doc:
|
|
|
|
cd $(CUR_DIR)/doc && make && make copy; cd $(CUR_DIR)
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
.PHONY: distribute
|
2008-03-17 11:35:12 +01:00
|
|
|
distribute: build dist_tarball dist_rpm
|
|
|
|
@echo "All distributions created successfully!"
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-17 11:35:12 +01:00
|
|
|
.PHONY: dist_tarball
|
|
|
|
dist_tarball: build
|
|
|
|
cd $(CUR_DIR)/dist && make tarball; cd $(CUR_DIR)
|
|
|
|
|
|
|
|
.PHONY: dist_rpm
|
|
|
|
dist_rpm: build
|
|
|
|
cd $(CUR_DIR)/dist && make rpm; cd $(CUR_DIR)
|
|
|
|
|
|
|
|
.PHONY: dist_deb
|
|
|
|
dist_deb: build
|
|
|
|
cd $(CUR_DIR)/dist && make deb; cd $(CUR_DIR)
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# 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}
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
#uninstall:
|
|
|
|
# cd ${UTT_DIR} && make uninstall; cd ${DIR}
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
#reinstall:
|
|
|
|
# cd ${UTT_DIR} && make reinstall; cd ${DIR}
|
2008-03-11 14:02:41 +01:00
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
#dist: all
|
|
|
|
# tar -czvf $(UTT_DIST_NAME).tgz $(UTT_DIR)
|
2008-03-11 14:02:41 +01:00
|
|
|
|
|
|
|
|
2008-03-13 12:45:16 +01:00
|
|
|
#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
|