Index: app/Makefile
===================================================================
--- app/Makefile	(revision 52bccead730bb580f6b4cb5ee2a732f8188a0b6a)
+++ app/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,32 +1,37 @@
 # 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
@@ -36,117 +41,87 @@
 	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}
-	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;\
+		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 $(CUR_DIR)/doc && make clean ; cd $(CUR_DIR)
 
-clean_doc:
-	cd $(DIR)/doc && make clean ; cd $(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!"
 
 
 
-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) 
+# ------------------------------------------------------------------
+# sekcja tworzenia dystrybucji (tarballa, rpm, deb)
+# ------------------------------------------------------------------
+.PHONY: distribute
+distribute:
+	@echo "We need to create distribution here!"
 
 
-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 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
Index: app/src/compiledic/Makefile
===================================================================
--- app/src/compiledic/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/compiledic/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,2 +1,5 @@
+CFLAG1 = -m32 -Wno-deprecated -O3 -fpermissive
+CFLAG_ST = -Wno-deprecated -O3 -fpermissive -static
+
 all: compiledic aut2fsa
 
@@ -4,5 +7,6 @@
 
 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
 
 
@@ -11,2 +15,6 @@
 	cp compiledic fsm2aut aut2fsa ${UTT_BIN_DIR}
 endif
+
+clean:
+	rm aut2fsa
+
Index: app/src/cor/Makefile
===================================================================
--- app/src/cor/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/cor/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -26,6 +26,6 @@
 	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:
Index: app/src/fla/Makefile
===================================================================
--- app/src/fla/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/fla/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,5 +1,7 @@
+PAR = -m32
+# -static
 
 fla: fla.c
-	gcc -static -o fla fla.c
+	gcc $(PAR) -o fla fla.c
 
 copy:
@@ -10,4 +12,2 @@
 clean:
 	rm fla
-
-uninstall:
Index: app/src/gph/Makefile
===================================================================
--- app/src/gph/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/gph/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -6,2 +6,4 @@
 	cp gph ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/grp/Makefile
===================================================================
--- app/src/grp/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/grp/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -5,2 +5,4 @@
 	cp grp ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/gue/Makefile
===================================================================
--- app/src/gue/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/gue/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,4 +1,5 @@
-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
@@ -25,6 +26,6 @@
 	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
 
 
Index: app/src/gue/cmdline_guess.ggo
===================================================================
--- app/src/gue/cmdline_guess.ggo	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/gue/cmdline_guess.ggo	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -5,6 +5,6 @@
 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
Index: app/src/kon/Makefile
===================================================================
--- app/src/kon/Makefile	(revision 52bccead730bb580f6b4cb5ee2a732f8188a0b6a)
+++ app/src/kon/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,4 +1,4 @@
 
-con:
+kon:
 
 copy:
@@ -6,2 +6,4 @@
 	    cp kon ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/kot/Makefile
===================================================================
--- app/src/kot/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/kot/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -6,2 +6,4 @@
 	cp kot ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/lib/Makefile
===================================================================
--- app/src/lib/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/lib/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,4 +1,5 @@
 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
@@ -16,5 +17,5 @@
 
 copy:
-ifdef UTT_LIB_DIR
-	cp -r perl $(UTT_LIB_DIR)/
-endif
+#ifdef UTT_LIB_DIR
+#	cp -r perl $(UTT_LIB_DIR)/
+#endif
Index: app/src/mar/Makefile
===================================================================
--- app/src/mar/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/mar/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -5,2 +5,4 @@
 	cp mar ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/rm12/Makefile
===================================================================
--- app/src/rm12/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/rm12/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -5,2 +5,4 @@
 	cp rm12 ${UTT_BIN_DIR}
 endif
+
+clean:
Index: app/src/rs12/Makefile
===================================================================
--- app/src/rs12/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/rs12/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,6 +1,9 @@
+PAR = -m32
+# -static
+
 main: rs12
 
 rs12: rs12.c
-	gcc -static -o rs12 rs12.c
+	gcc $(PAR) -o rs12 rs12.c
 
 clean:
Index: app/src/sen-l/Makefile
===================================================================
--- app/src/sen-l/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/sen-l/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,3 +1,2 @@
-
 
 sen: sen.l
@@ -12,4 +11,2 @@
 clean:
 	rm sen.c sen
-
-uninstall:
Index: app/src/ser/Makefile
===================================================================
--- app/src/ser/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/ser/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -8,4 +8,2 @@
 
 clean:
-
-uninstall:
Index: app/src/tags/Makefile
===================================================================
--- app/src/tags/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/tags/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -2,6 +2,6 @@
 
 copy:
-ifdef UTT_TAGS_DIR
-	cp *.tag2re ${UTT_TAGS_DIR}
+ifdef UTT_BIN_DIR
+	cp *.tag2re ${UTT_BIN_DIR}
 endif
 
Index: app/src/tok.l/Makefile
===================================================================
--- app/src/tok.l/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/tok.l/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -1,3 +1,4 @@
-PAR=-O3 -static
+PAR=-O3 -m32
+#-static
 
 tok: tok.c cmdline.c
Index: app/src/unfla/Makefile
===================================================================
--- app/src/unfla/Makefile	(revision 25ae32e4c2354e0ed6756bbe1de83f39cd814652)
+++ app/src/unfla/Makefile	(revision 8d3e6ab33b2b6727eb54bb3498a0ba2af9ca9ea1)
@@ -5,2 +5,4 @@
 	cp unfla ${UTT_BIN_DIR}
 endif
+
+clean:
