From 13a8a67bce500a27f4c2121c096be175d5daab52 Mon Sep 17 00:00:00 2001 From: pawelk Date: Thu, 1 May 2008 20:27:23 +0000 Subject: [PATCH] Przejrzalem narzedzia pod katem includow CMDLINE_FILE. Gdzie mozna bylo, usunalem. Jest pewien balagan w Makefile'ach, bo nadmiarowo dodalem -D .... Calosc sie kompiluje i generuje sie tarball. git-svn-id: svn://atos.wmid.amu.edu.pl/utt@36 e293616e-ec6a-49c2-aa92-f4a8b91c5d16 --- app/src/common/common.h | 4 ++++ app/src/cor/Makefile | 4 ++-- app/src/cor/common_cor.h | 2 +- app/src/cor/main.cc | 2 +- app/src/dgp/Makefile | 4 ++-- app/src/dgp/main.cc | 2 +- app/src/kor/Makefile | 8 ++++---- app/src/kor/common_cor.h | 5 +---- app/src/lem/Makefile | 7 ++++--- app/src/lem/common_lem.h | 1 - app/src/lem/main.cc | 2 +- app/src/tok.c/Makefile | 12 ++++++------ app/src/tok.c/common_tok.h | 1 - 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/src/common/common.h b/app/src/common/common.h index b19ded7..27c9117 100644 --- a/app/src/common/common.h +++ b/app/src/common/common.h @@ -8,7 +8,11 @@ #include "../lib/const.h" +#ifndef _CMDLINE_FILE +#error _CMDLINE_FILE constant not defined! +#else #include _CMDLINE_FILE +#endif /************************************************** diff --git a/app/src/cor/Makefile b/app/src/cor/Makefile index 7c7b7ff..ecdfa12 100644 --- a/app/src/cor/Makefile +++ b/app/src/cor/Makefile @@ -8,7 +8,7 @@ CMDLINE_FILE='"../cor/cmdline.h"' cor: main.cc corr.o $(LIB_PATH)/word.o \ $(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o - g++ $(PAR) main.cc corr.o common.o \ + g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corr.o common.o \ $(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \ -o cor @@ -20,7 +20,7 @@ common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \ g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc common_cor.o: cmdline.h common_cor.cc common_cor.h - g++ $(PAR2) common_cor.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser diff --git a/app/src/cor/common_cor.h b/app/src/cor/common_cor.h index f815e4e..83b2948 100644 --- a/app/src/cor/common_cor.h +++ b/app/src/cor/common_cor.h @@ -3,7 +3,7 @@ #include -#define _CMDLINE_FILE "../cor/cmdline.h" +//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h" #include "../common/common.h" #include "cmdline.h" diff --git a/app/src/cor/main.cc b/app/src/cor/main.cc index 23380a6..a109c86 100644 --- a/app/src/cor/main.cc +++ b/app/src/cor/main.cc @@ -1,7 +1,7 @@ #include #include #include "../lib/iotools.h" -#define _CMDLINE_FILE "../cor/cmdline.h" +//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../cor/cmdline.h" #include "../common/common.h" #include "common_cor.h" #include "corr.hh" diff --git a/app/src/dgp/Makefile b/app/src/dgp/Makefile index bdf9646..4bc24f9 100644 --- a/app/src/dgp/Makefile +++ b/app/src/dgp/Makefile @@ -19,7 +19,7 @@ bin = dgp objs = $(sources:%.cc=%.o) ${bin}: ${objs} - ${CXX} ${CXXFLAGS} -o $@ ${objs} + ${CXX} ${CXXFLAGS} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} include $(sources:.cc=.d) @@ -27,7 +27,7 @@ include $(sources:.cc=.d) ${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $< %.d: %.cc - $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \ + $(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ diff --git a/app/src/dgp/main.cc b/app/src/dgp/main.cc index e8e9906..aa838b7 100644 --- a/app/src/dgp/main.cc +++ b/app/src/dgp/main.cc @@ -6,13 +6,13 @@ * Author: Tomasz Obrebski */ -#include "cmdline.h" #include "global.hh" #include "mgraph.hh" #include "sgraph.hh" #include "grammar.hh" #include "dgp0.hh" #include "../common/common.h" +#include "cmdline.h" #define MAXSEGMENTS 500 diff --git a/app/src/kor/Makefile b/app/src/kor/Makefile index 01399f6..62dbc94 100755 --- a/app/src/kor/Makefile +++ b/app/src/kor/Makefile @@ -8,15 +8,15 @@ CMDLINE_FILE='"../kor/cmdline.h"' kor: main.cc corr.o corlist.o cmdline.o $(LIB_PATH)/word.o \ $(LIB_PATH)/auttools.o cmdline.c common_cor.o common.o - g++ $(PAR) main.cc corlist.o corr.o common.o \ + g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) main.cc corlist.o corr.o common.o \ $(LIB_PATH)/word.o $(LIB_PATH)/auttools.o cmdline.c common_cor.o \ -o kor corr.o: corr.cc corr.hh cmdline.h - g++ $(PAR2) corr.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corr.cc corlist.o: corlist.cc corlist.h cmdline.h - g++ $(PAR2) corlist.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) corlist.cc @@ -25,7 +25,7 @@ common.o: cmdline.h $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \ g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc common_cor.o: cmdline.h common_cor.cc common_cor.h - g++ $(PAR2) common_cor.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_cor.cc cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser diff --git a/app/src/kor/common_cor.h b/app/src/kor/common_cor.h index f6f0dff..5572cbd 100755 --- a/app/src/kor/common_cor.h +++ b/app/src/kor/common_cor.h @@ -2,9 +2,6 @@ #define __COMMON_COR_H // SEKCJA STALYCH -#ifndef _CMDLINE_FILE - #define _CMDLINE_FILE "../kor/cmdline.h" -#endif #define MAX_LEN 2 #define PREC 1000 @@ -12,7 +9,7 @@ // SEKCJA INCLUDOW #include "../common/common.h" -#include _CMDLINE_FILE +#include "cmdline.h" // SEKCJA GENGETOPT diff --git a/app/src/lem/Makefile b/app/src/lem/Makefile index 49e201f..bbfe110 100644 --- a/app/src/lem/Makefile +++ b/app/src/lem/Makefile @@ -8,12 +8,13 @@ CMDLINE_FILE='"../lem/cmdline.h"' lem: main.cc lem.o $(LIB_PATH)/auttools.o $(LIB_PATH)/word.o \ cmdline.c common_lem.o common.o symtab.o - g++ $(PAR) main.cc lem.o $(LIB_PATH)/auttools.o \ + g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \ + main.cc lem.o $(LIB_PATH)/auttools.o \ $(LIB_PATH)/word.o cmdline.c common.o common_lem.o \ symtab.o -o lem lem.o: lem.h lem.cc - g++ $(PAR2) lem.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) lem.cc # alphabet.o: $(LIB_PATH)/alphabet.h $(LIB_PATH)/alphabet.cc # g++ $(PAR2) $(LIB_PATH)/alphabet.cc @@ -32,7 +33,7 @@ common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \ g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc common_lem.o: cmdline.h common_lem.h common_lem.cc - g++ $(PAR2) common_lem.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_lem.cc cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser diff --git a/app/src/lem/common_lem.h b/app/src/lem/common_lem.h index fe640c9..86bc400 100644 --- a/app/src/lem/common_lem.h +++ b/app/src/lem/common_lem.h @@ -2,7 +2,6 @@ #define __COMMON_LEM__H #include -#define _CMDLINE_FILE "../lem/cmdline.h" #include "../common/common.h" #include "cmdline.h" diff --git a/app/src/lem/main.cc b/app/src/lem/main.cc index 01526a4..534a032 100644 --- a/app/src/lem/main.cc +++ b/app/src/lem/main.cc @@ -1,5 +1,5 @@ #include "../lib/iotools.h" -#define _CMDLINE_FILE "../lem/cmdline.h" +//do wyrzucenia - definicja w Makefile! #define _CMDLINE_FILE "../lem/cmdline.h" #include "../common/common.h" #include "common_lem.h" #include "lem.h" diff --git a/app/src/tok.c/Makefile b/app/src/tok.c/Makefile index 6b0efba..8bdf536 100644 --- a/app/src/tok.c/Makefile +++ b/app/src/tok.c/Makefile @@ -5,16 +5,17 @@ CMDLINE_FILE='"../tok.c/cmdline.h"' tok: tok.o cmdline.c common_tok.o common.o - g++ $(PAR) tok.c cmdline.c common.o common_tok.o -o tok + g++ $(PAR) -D _CMDLINE_FILE=$(CMDLINE_FILE) \ + tok.c cmdline.c common.o common_tok.o -o tok tok.o: tok.c cmdline.h - g++ $(PAR2) tok.c + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) tok.c common_tok.o: cmdline.h common_tok.cc common_tok.h - g++ $(PAR2) common_tok.cc + g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) common_tok.cc -common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc\ - $(COMMON_PATH)/common.h +common.o: $(COMMON_PATH)/cmdline_common.ggo $(COMMON_PATH)/common.cc \ + $(COMMON_PATH)/common.h g++ $(PAR2) -D _CMDLINE_FILE=$(CMDLINE_FILE) $(COMMON_PATH)/common.cc cmdline.ggo: cmdline_tok.ggo ../common/cmdline_common.ggo @@ -23,7 +24,6 @@ cmdline.ggo: cmdline_tok.ggo ../common/cmdline_common.ggo cmdline.c cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --conf-parser - copy: ifdef UTT_BIN_DIR cp tok ${UTT_BIN_DIR}/ diff --git a/app/src/tok.c/common_tok.h b/app/src/tok.c/common_tok.h index 68e6395..327e6b0 100644 --- a/app/src/tok.c/common_tok.h +++ b/app/src/tok.c/common_tok.h @@ -2,7 +2,6 @@ #define __COMMON_TOK__H #include -#define _CMDLINE_FILE "../tok.c/cmdline.h" #include "../common/common.h" #include "cmdline.h"