diff --git a/app/Makefile b/app/Makefile index 60947f4..8c60ac5 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,33 +1,38 @@ # main makefile -BIN=bin -SRC=src -DIR=$(shell pwd) +# ****************************** +# * 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 ############################## -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 +COMPONENTS = compiledic cor fla gph grp kon kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla +# gue nie dziala! ############################## -all: dirs components conf doc lang tags files share - @echo "Make completed successfully!" +# ------------------------------------------------------------------ +# sekcja kompilacji (kompiluje i wgrywa do OUTPUT_DIR) +# ------------------------------------------------------------------ +.PHONY: compile +compile: dirs components + @echo "Make compiled successfully!" .PHONY: dirs dirs: @@ -35,118 +40,88 @@ dirs: 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} + mkdir -p ${UTT_LIB_DIR} + mkdir -p ${UTT_SHARE_DIR} .PHONY: components components: @for cmp in $(COMPONENTS); do\ - make $$cmp;\ + cd $(SRC_DIR)/$$cmp && make && make copy; cd $(CUR_DIR); \ 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} - +# ------------------------------------------------------------------ +# 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)/$$cmp && make clean ; cd $(DIR); \ + cd $(SRC_DIR)/$$cmp && make clean ; cd $(CUR_DIR); \ done + cd $(SRC_DIR)/lib && make clean; cd $(CUR_DIR); -clean_lib: - cd $(SRC)/lib && make clean - +.PHONY: clean_doc 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) - + cd $(CUR_DIR)/doc && make clean ; cd $(CUR_DIR) +.PHONY: clean_dist 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 + +# ------------------------------------------------------------------ +# 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 diff --git a/app/src/compiledic/Makefile b/app/src/compiledic/Makefile index cc586bb..1e8a754 100644 --- a/app/src/compiledic/Makefile +++ b/app/src/compiledic/Makefile @@ -1,12 +1,20 @@ +CFLAG1 = -m32 -Wno-deprecated -O3 -fpermissive +CFLAG_ST = -Wno-deprecated -O3 -fpermissive -static + all: compiledic aut2fsa compiledic: aut2fsa: aut2fsa.cc - g++ -Wno-deprecated -O3 -fpermissive -static -o aut2fsa aut2fsa.cc + #g++ -m32 -Wno-deprecated -O3 -fpermissive -static -o aut2fsa aut2fsa.cc + g++ $(CFLAG1) -o aut2fsa aut2fsa.cc copy: ifdef UTT_BIN_DIR cp compiledic fsm2aut aut2fsa ${UTT_BIN_DIR} endif + +clean: + rm aut2fsa + diff --git a/app/src/cor/Makefile b/app/src/cor/Makefile index 67ff4ea..7c7b7ff 100644 --- a/app/src/cor/Makefile +++ b/app/src/cor/Makefile @@ -25,8 +25,8 @@ common_cor.o: cmdline.h common_cor.cc common_cor.h cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser -cmdline.ggo: cmdline_cor.ggo ../common/cmdline_common.ggo - cat cmdline_cor.ggo ../common/cmdline_common.ggo > cmdline.ggo +cmdline.ggo: cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo + cat cmdline_cor.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo copy: ifdef UTT_BIN_DIR diff --git a/app/src/fla/Makefile b/app/src/fla/Makefile index 4bf3e08..b048129 100644 --- a/app/src/fla/Makefile +++ b/app/src/fla/Makefile @@ -1,6 +1,8 @@ +PAR = -m32 +# -static fla: fla.c - gcc -static -o fla fla.c + gcc $(PAR) -o fla fla.c copy: ifdef UTT_BIN_DIR @@ -9,5 +11,3 @@ endif clean: rm fla - -uninstall: \ No newline at end of file diff --git a/app/src/gph/Makefile b/app/src/gph/Makefile index 129e815..ff1c57f 100644 --- a/app/src/gph/Makefile +++ b/app/src/gph/Makefile @@ -5,3 +5,5 @@ copy: ifdef UTT_BIN_DIR cp gph ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/grp/Makefile b/app/src/grp/Makefile index e0ca5c1..bcf5b90 100644 --- a/app/src/grp/Makefile +++ b/app/src/grp/Makefile @@ -4,3 +4,5 @@ copy: ifdef UTT_BIN_DIR cp grp ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/gue/Makefile b/app/src/gue/Makefile index 7fb9380..135d71f 100644 --- a/app/src/gue/Makefile +++ b/app/src/gue/Makefile @@ -1,5 +1,6 @@ -PAR=-Wno-deprecated -O3 -fpermissive -static -PAR2=-c -Wno-deprecated -O3 -fpermissive +PAR=-Wno-deprecated -O3 -fpermissive -m32 +#-static +PAR2=-c -Wno-deprecated -O3 -fpermissive -m32 LIB_PATH=../lib COMMON_PATH=../common CMDLINE_FILE='"../gue/cmdline.h"' @@ -24,8 +25,8 @@ common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \ cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser -cmdline.ggo: cmdline_guess.ggo ../common/cmdline_common.ggo - cat cmdline_guess.ggo ../common/cmdline_common.ggo > cmdline.ggo +cmdline.ggo: cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo + cat cmdline_guess.ggo $(COMMON_PATH)/cmdline_common.ggo > cmdline.ggo clean: clean.cmdline diff --git a/app/src/gue/cmdline_guess.ggo b/app/src/gue/cmdline_guess.ggo index e94fec3..1b68b02 100644 --- a/app/src/gue/cmdline_guess.ggo +++ b/app/src/gue/cmdline_guess.ggo @@ -4,8 +4,8 @@ version "0.1" option "guess_count" n "Guess up to n descriptions" int default="0" no option "delta" - "Stop displaying answers after fall of weight" float default="0.2" no option "cut-off" - "Do not display answers with less weight than cut-off" int default="200" no -option "dictionary-home" - "dh" hidden -option "dictionary" d "File with dictionary information" string typestr="filename" default="~/.utt/lang/pl_PL.ISO-8859-2/gue.bin" no +option "dictionary-home" - "dh" string typestr="FILENAME" no hidden +option "dictionary" d "File with dictionary information" string typestr="filename" default="gue.bin" no option "per-info" v "Display performance information" flag off option "weights" w "Print weights" flag off hidden option "no-uppercase" - "Do not process form containing uppercase letters" flag off diff --git a/app/src/kon/Makefile b/app/src/kon/Makefile index 121ebf5..ac3fbd3 100644 --- a/app/src/kon/Makefile +++ b/app/src/kon/Makefile @@ -1,7 +1,9 @@ -con: +kon: copy: ifdef UTT_BIN_DIR cp kon ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/kot/Makefile b/app/src/kot/Makefile index 6619715..e8f57e2 100644 --- a/app/src/kot/Makefile +++ b/app/src/kot/Makefile @@ -5,3 +5,5 @@ copy: ifdef UTT_BIN_DIR cp kot ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/lib/Makefile b/app/src/lib/Makefile index 5dfc8c9..708f12d 100644 --- a/app/src/lib/Makefile +++ b/app/src/lib/Makefile @@ -1,5 +1,6 @@ PAR=-Wno-deprecated -m32 -O3 -PAR2=-c -Wno-deprecated -m32 -O3 -static -fpermissive +PAR2=-c -Wno-deprecated -m32 -O3 -fpermissive +# -static LIB_PATH=../lib COMMON_PATH=../common @@ -15,6 +16,6 @@ clean: rm *.o copy: -ifdef UTT_LIB_DIR - cp -r perl $(UTT_LIB_DIR)/ -endif +#ifdef UTT_LIB_DIR +# cp -r perl $(UTT_LIB_DIR)/ +#endif diff --git a/app/src/mar/Makefile b/app/src/mar/Makefile index 63da335..ad80b1b 100644 --- a/app/src/mar/Makefile +++ b/app/src/mar/Makefile @@ -4,3 +4,5 @@ copy: ifdef UTT_BIN_DIR cp mar ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/rm12/Makefile b/app/src/rm12/Makefile index 98bf295..bbde7a5 100644 --- a/app/src/rm12/Makefile +++ b/app/src/rm12/Makefile @@ -4,3 +4,5 @@ copy: ifdef UTT_BIN_DIR cp rm12 ${UTT_BIN_DIR} endif + +clean: diff --git a/app/src/rs12/Makefile b/app/src/rs12/Makefile index 9c45a39..0be6e3a 100644 --- a/app/src/rs12/Makefile +++ b/app/src/rs12/Makefile @@ -1,7 +1,10 @@ +PAR = -m32 +# -static + main: rs12 rs12: rs12.c - gcc -static -o rs12 rs12.c + gcc $(PAR) -o rs12 rs12.c clean: rm rs12 diff --git a/app/src/sen-l/Makefile b/app/src/sen-l/Makefile index 5a3601e..a26059d 100644 --- a/app/src/sen-l/Makefile +++ b/app/src/sen-l/Makefile @@ -1,5 +1,4 @@ - sen: sen.l flex -osen.c sen.l cc -O3 -o sen sen.c -lfl @@ -11,5 +10,3 @@ endif clean: rm sen.c sen - -uninstall: diff --git a/app/src/ser/Makefile b/app/src/ser/Makefile index a0ea0fe..f83ff80 100644 --- a/app/src/ser/Makefile +++ b/app/src/ser/Makefile @@ -7,5 +7,3 @@ ifdef UTT_BIN_DIR endif clean: - -uninstall: diff --git a/app/src/tags/Makefile b/app/src/tags/Makefile index 1775f12..80dc519 100644 --- a/app/src/tags/Makefile +++ b/app/src/tags/Makefile @@ -1,8 +1,8 @@ main: copy: -ifdef UTT_TAGS_DIR - cp *.tag2re ${UTT_TAGS_DIR} +ifdef UTT_BIN_DIR + cp *.tag2re ${UTT_BIN_DIR} endif clean: diff --git a/app/src/tok.l/Makefile b/app/src/tok.l/Makefile index 0cbb3fc..6c4530f 100644 --- a/app/src/tok.l/Makefile +++ b/app/src/tok.l/Makefile @@ -1,4 +1,5 @@ -PAR=-O3 -static +PAR=-O3 -m32 +#-static tok: tok.c cmdline.c cc $(PAR) tok.c cmdline.c -o tok diff --git a/app/src/unfla/Makefile b/app/src/unfla/Makefile index 6c055d0..5871f83 100644 --- a/app/src/unfla/Makefile +++ b/app/src/unfla/Makefile @@ -4,3 +4,5 @@ copy: ifdef UTT_BIN_DIR cp unfla ${UTT_BIN_DIR} endif + +clean: