Index: Makefile
===================================================================
--- Makefile	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ Makefile	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -19,5 +19,4 @@
 components:
 	cd $(SRC_DIR)/lib && make; cd $(CUR_DIR)
-	
 	@for cmp in $(COMPONENTS); do\
 		cd $(SRC_DIR)/$$cmp && make; cd $(CUR_DIR); \
@@ -30,4 +29,5 @@
 .PHONY: configuration
 configuration:
+	cd $(CUR_DIR)/conf && make; cd $(CUR_DIR)
 
 .PHONY: libraries
@@ -41,5 +41,5 @@
 # ------------------------------------------------------------------
 .PHONY: clean
-clean: clean_components clean_documentation
+clean: clean_components clean_documentation clean_config
 	@echo "All files cleaned successfully!"
 
@@ -55,4 +55,8 @@
 	cd $(CUR_DIR)/doc && make clean; cd $(CUR_DIR)
 
+.PHONY: clean_config
+clean_config:
+	cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR)
+
 # ------------------------------------------------------------------
 # install section
@@ -60,5 +64,5 @@
 .PHONY: install
 install: all install_dirs install_components install_configuration install_libraries install_documentation install_share
-	
+
 .PHONY: install_dirs
 install_dirs:
Index: conf/Makefile
===================================================================
--- conf/Makefile	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ conf/Makefile	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -1,3 +1,14 @@
 include ../config.mak
+
+.PHONY: all
+all: compiledic.conf cor.conf dgc.conf dgp.conf gph.conf grp.conf gue.conf kor.conf lem.conf mar.conf ser.conf utt.conf
+
+%.conf: %.conf.m4
+	m4 --define=LANG_DIR=${LANG_DIR} --define=LIB_DIR=${LIB_DIR} $< > $@
+
+
+.PHONY: clean
+clean:
+	rm *.conf
 
 .PHONY: install
Index: nf/compiledic.conf
===================================================================
--- conf/compiledic.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-symbols = PATH_PREFIX/share/utt/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
Index: conf/compiledic.conf.m4
===================================================================
--- conf/compiledic.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/compiledic.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,13 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+symbols = LANG_DIR/pl_PL.ISO-8859-2/pl_PL.ISO-8859-2.sym
Index: nf/cor.conf
===================================================================
--- conf/cor.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: conf/cor.conf.m4
===================================================================
--- conf/cor.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/cor.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = LANG_DIR
+process = W
Index: nf/dgc.conf
===================================================================
--- conf/dgc.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-categories = PATH_PREFIX/share/utt/cats.dgc
-grammar = PATH_PREFIX/share/utt/gram.dgc
-outputfile = PATH_PREFIX/share/utt/gram.dgp
Index: conf/dgc.conf.m4
===================================================================
--- conf/dgc.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/dgc.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+categories = LANG_DIR/cats.dgc
+grammar = LANG_DIR/gram.dgc
+outputfile = LANG_DIR/gram.dgp
Index: nf/dgp.conf
===================================================================
--- conf/dgp.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,18 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-
-grammar = PATH_PREFIX/share/utt/gram.dgp
-process = W
-process = BOS
-process = EOS
-info = d
Index: conf/dgp.conf.m4
===================================================================
--- conf/dgp.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/dgp.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,18 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+
+grammar = LANG_DIR/gram.dgp
+process = W
+process = BOS
+process = EOS
+info = d
Index: nf/gph.conf
===================================================================
--- conf/gph.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-process = W
-process = BOS
-process = EOS
-reset = BOS
Index: conf/gph.conf.m4
===================================================================
--- conf/gph.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/gph.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,16 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+process = W
+process = BOS
+process = EOS
+reset = BOS
Index: nf/grp.conf
===================================================================
--- conf/grp.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-tags=uam
-
Index: conf/grp.conf.m4
===================================================================
--- conf/grp.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/grp.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = LIB_DIR/terms.m4
+tags=uam
+
Index: nf/gue.conf
===================================================================
--- conf/gue.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: conf/gue.conf.m4
===================================================================
--- conf/gue.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/gue.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = LANG_DIR
+process = W
Index: nf/kor.conf
===================================================================
--- conf/kor.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,16 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-weights = PATH_PREFIX/share/utt/weights.kor
-threshold = 1.0
-process=W
Index: conf/kor.conf.m4
===================================================================
--- conf/kor.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/kor.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,16 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = LANG_DIR
+weights = LANG_DIR/weights.kor
+threshold = 1.0
+process=W
Index: nf/lem.conf
===================================================================
--- conf/lem.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-dictionary-home = PATH_PREFIX/share/utt
-process = W
Index: conf/lem.conf.m4
===================================================================
--- conf/lem.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/lem.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+dictionary-home = LANG_DIR
+process = W
Index: nf/mar.conf
===================================================================
--- conf/mar.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-tags=uam
-
Index: conf/mar.conf.m4
===================================================================
--- conf/mar.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/mar.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = LIB_DIR/terms.m4
+tags=uam
+
Index: nf/ser.conf
===================================================================
--- conf/ser.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,15 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-macros = PATH_PREFIX/lib/utt/terms.m4
-flex-template = PATH_PREFIX/lib/utt/ser.l.template
-tags=uam
Index: conf/ser.conf.m4
===================================================================
--- conf/ser.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/ser.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,15 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+macros = LIB_DIR/terms.m4
+flex-template = LIB_DIR/ser.l.template
+tags=uam
Index: nf/utt.conf
===================================================================
--- conf/utt.conf	(revision f712e1663858afe196bd412133094bc0e070db5b)
+++ 	(revision )
@@ -1,14 +1,0 @@
-# ************************************************************
-# * This file was created automatically during installation. *
-# * If you don't need do not change it.                      *
-# *                                                          *
-# * UAM Text Tools                                           *
-# * Adam Mickiewicz University, Poland                       *
-# * http://utt.amu.edu.pl                                    *
-# ************************************************************
-#
-# All lines must looks like:
-# parameter_name [=] value
-#
-# user locale (dictionary)
-language = pl_PL.ISO-8859-2
Index: conf/utt.conf.m4
===================================================================
--- conf/utt.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
+++ conf/utt.conf.m4	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,14 @@
+# ************************************************************
+# * This file was created automatically during installation. *
+# * If you don't need do not change it.                      *
+# *                                                          *
+# * UAM Text Tools                                           *
+# * Adam Mickiewicz University, Poland                       *
+# * http://utt.amu.edu.pl                                    *
+# ************************************************************
+#
+# All lines must looks like:
+# parameter_name [=] value
+#
+# user locale (dictionary)
+language = pl_PL.ISO-8859-2
Index: src/common/common.cc
===================================================================
--- src/common/common.cc	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/common/common.cc	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -109,4 +109,5 @@
   // obsluga systemowego pliku konfiguracyjnego dla programu
   sprintf(config_file, "%s/%s.conf", SYSTEM_CONFIG_DIR, program_name);
+
   if (file_accessible(config_file) == 0) {
     if (cmdline_parser_configfile(config_file,
Index: src/common/common.d
===================================================================
--- src/common/common.d	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/common/common.d	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -0,0 +1,2 @@
+common.o: ../common/common.cc ../common/common.h ../common/../lib/const.h \
+ ../common/../dgp/cmdline.h
Index: src/lem/Makefile
===================================================================
--- src/lem/Makefile	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/lem/Makefile	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -1,2 +1,4 @@
+include ../../config.mak
+
 LDFLAGS += -static
 CXXFLAGS += -O2 -fpermissive
@@ -40,6 +42,13 @@
 	rm cmdline.* || true
 
-copy:
-ifdef UTT_BIN_DIR
-	cp lem $(UTT_BIN_DIR)
+.PHONY: install
+install:
+ifdef BIN_DIR
+	install -m 0755 lem $(BIN_DIR)
 endif
+
+.PHONY: uninstall
+uninstall:
+ifdef BIN_DIR
+	rm $(BIN_DIR)/lem
+endif
Index: src/lem/main.cc
===================================================================
--- src/lem/main.cc	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/lem/main.cc	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -33,5 +33,5 @@
     lem = new AuxLem(dictionary);
   else
-    fprintf(stderr,"lem: Invalid dictionary file extension.\n");
+    fprintf(stderr,"lem: Dictionary file not found.\n");
 
   Words tab;
Index: src/lib/const.h
===================================================================
--- src/lib/const.h	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/lib/const.h	(revision cfdf333a512778a753f04c7ce616075f6059e7bb)
@@ -21,4 +21,4 @@
 
 // katalogi z plikami konfiguracyjnymi
-#define SYSTEM_CONFIG_DIR "/usr/local/etc/utt"
+#define SYSTEM_CONFIG_DIR "/etc/utt"
 #define USER_CONFIG_DIR "~/.utt" 
