CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / Makefile
blob70ce40221d291367eefdb8d83a276b8ad990b396
1 # To build Linguistica, execute "make".
2 # Run "make V=1" to see the actual commands being run.
3 # See ./README for more information.
4 all: linguistica
6 # Define CXX to the version of g++ you prefer to use.
8 # Define CFLAGS with flags to pass to g++ during compilation
9 # (e.g. -Os -Wall -W).
11 # Define LDFLAGS with flags to pass to g++ during linking.
13 # Define NO_PKGCONFIG to disable use of pkg-config during the build
14 # (e.g. if /usr/lib/pkgconfig/QtCore.pc contains nonsense).
16 # Define MOC to the version of the Qt meta-object compiler command
17 # you prefer to use (e.g. moc-qt4).
19 # Define UIC to the version of the Qt user-interface compiler you
20 # prefer to use (e.g. uic-qt4).
22 # Define RCC to the version of the Qt resource compiler you prefer
23 # to use (e.g. rcc).
25 # Define NO_GRAPHVIZ to disable the morphological finite-state
26 # machine graphical display.
28 # Define GRAPHVIZ_LIB to flags to link to and GRAPHVIZ_CFLAGS to
29 # flags to compile with the GraphVizContext library. Example:
30 # GRAPHVIZ_LIB = -L/usr/lib/graphviz -Wl,-rpath,/usr/lib/graphviz -lgvc
31 # GRAPHVIZ_CFLAGS = -I/usr/include/graphviz
33 # Define QT_LIB to flags to link and QT_CFLAGS to flags to
34 # compile with Qt 4, including the QtGui, Qt3Support, and QtXml
35 # modules. Example:
36 # QT_LIB = -lQt3Support -lQtGui -lQtNetwork -lQtSql -lQtXml -lQtCore
37 # QT_CFLAGS = -DQT_SHARED -DQT3_SUPPORT -I/usr/include/qt4 \
38 # -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore \
39 # -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtNetwork \
40 # -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtXml
42 CFLAGS = -g -O2 -Wall -W
43 LDFLAGS =
45 CXX = g++
46 RCC = rcc
47 MOC = moc-qt4
48 UIC = uic-qt4
49 QT_LIB = -lQt3Support -lQtGui -lQtXml -lQtCore
50 QT_CFLAGS = -DQT_SHARED -DQT3_SUPPORT -I/usr/include/qt4 \
51 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore \
52 -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtXml
53 GRAPHVIZ_LIB = -L/usr/lib/graphviz -Wl,-rpath,/usr/lib/graphviz -lgvc
54 GRAPHVIZ_CFLAGS = -I/usr/include/graphviz
56 ifeq ($(shell type pkg-config > /dev/null 2>&1 || echo n),n)
57 NO_PKGCONFIG = YesUnfortunately
58 endif
60 -include config.mak
62 ifndef NO_PKGCONFIG
63 pkgconfig_failed = \
64 $(error Run “make NO_PKGCONFIG=YesPlease” to disable use of pkg-config)
66 define find_qt_command
67 $(1) := $$(shell pkg-config --print-errors \
68 --variable=$(2)_location QtCore)
70 ifeq ($$(shell type "$$($(1))" > /dev/null || echo n),n)
71 $$(pkgconfig_failed)
72 endif
73 endef
74 $(eval $(call find_qt_command,MOC,moc))
75 $(eval $(call find_qt_command,UIC,uic))
77 QT_LIB := $(shell pkg-config --print-errors \
78 --libs QtGui Qt3Support QtXml QtCore)
79 QT_CFLAGS := $(shell pkg-config --print-errors \
80 --cflags QtGui Qt3Support QtXml QtCore) \
81 -DQT3_SUPPORT
83 ifeq ($(shell pkg-config --exists libgvc || echo n),n)
84 NO_GRAPHVIZ = YesUnfortunately
85 endif
87 ifndef NO_GRAPHVIZ
88 GRAPHVIZ_LIB := $(shell pkg-config --print-errors --libs libgvc)
89 GRAPHVIZ_CFLAGS := $(shell pkg-config --print-errors --cflags libgvc)
90 endif
91 endif
93 ifdef NO_GRAPHVIZ
94 GRAPHVIZ_LIB :=
95 GRAPHVIZ_CFLAGS :=
96 ALL_GRAPHVIZ_CFLAGS :=
97 else
98 ALL_GRAPHVIZ_CFLAGS ?= $(GRAPHVIZ_CFLAGS) -DUSE_GRAPHVIZ
99 endif
101 ifdef CXXFLAGS
102 CFLAGS := $(CXXFLAGS)
103 endif
105 # The compiler should not rely on strict aliasing rules,
106 # since QMap violates them.
108 ALL_CFLAGS ?= $(CFLAGS) -Iinclude -fno-strict-aliasing \
109 $(QT_CFLAGS) $(ALL_GRAPHVIZ_CFLAGS)
110 ALL_LDFLAGS ?= $(LDFLAGS)
111 LIBS ?= $(GRAPHVIZ_LIB) $(QT_LIB)
113 OBJECTS += Affix.o
114 OBJECTS += Alignment.o
115 OBJECTS += Allomorphy.o
116 OBJECTS += Biphone.o
117 OBJECTS += BiphoneCollection.o
118 OBJECTS += canvasdialog.o
119 OBJECTS += cMT.o
120 OBJECTS += cMTModel1.o
121 OBJECTS += cMTModel2Norm.o
122 OBJECTS += CommandLine.o
123 OBJECTS += CompareFunc.o
124 OBJECTS += Compound.o
125 OBJECTS += CompoundCollection.o
126 OBJECTS += corpusviewdialog.o
127 OBJECTS += CorpusWord.o
128 OBJECTS += CorpusWordCollection.o
129 OBJECTS += Datum.o
130 OBJECTS += DCNcorpussyl.o
131 OBJECTS += DCNdcnword.o
132 OBJECTS += DCNgrammar.o
133 OBJECTS += DCNgrammarsyl.o
134 OBJECTS += DCNlearning.o
135 OBJECTS += DCNlearningsyl.o
136 OBJECTS += DCNnetwork.o
137 OBJECTS += DCNnetworksyl.o
138 OBJECTS += DCNsnetwork.o
139 OBJECTS += DescriptionLength.o
140 OBJECTS += DLHistory.o
141 OBJECTS += EarleyParser.o
142 OBJECTS += Edge.o
143 OBJECTS += exportwizard.o
144 OBJECTS += exportwizard_exporting.o
145 OBJECTS += FSA.o
146 OBJECTS += GrammarRule.o
147 OBJECTS += GraphicView.o
148 OBJECTS += GUI_Lexicon.o
149 OBJECTS += GUIclasses.o
150 OBJECTS += helpaboutdialog.o
151 OBJECTS += HTML.o
152 OBJECTS += Lexicon.o
153 OBJECTS += Lexicon_Allomorphy.o
154 OBJECTS += Lexicon_Compounds.o
155 OBJECTS += linepropertiesdialog.o
156 OBJECTS += linguisticamainwindow.o
157 OBJECTS += linguisticamainwindow_collectionview.o
158 OBJECTS += linguisticamainwindow_commandline.o
159 OBJECTS += linguisticamainwindow_DCN.o
160 OBJECTS += linguisticamainwindow_goldstandard.o
161 OBJECTS += linguisticamainwindow_graphicdisplay.o
162 OBJECTS += linguisticamainwindow_preferences.o
163 OBJECTS += linguisticamainwindow_treeview.o
164 OBJECTS += Linker.o
165 OBJECTS += LinkerCollection.o
166 OBJECTS += listbuilderdialog.o
167 OBJECTS += LParse.o
168 OBJECTS += LPreferences.o
169 OBJECTS += main.o
170 OBJECTS += MiniLexicon.o
171 OBJECTS += MiniLexicon_Allomorphy.o
172 OBJECTS += MiniLexicon_CheckAffixes.o
173 OBJECTS += MiniLexicon_Core.o
174 OBJECTS += MiniLexicon_SingletonSignatures.o
175 OBJECTS += MiniLexicon_SuccessorFreqs.o
176 OBJECTS += MonteCarlo.o
177 OBJECTS += Morpheme.o
178 OBJECTS += MorphemeCollection.o
179 OBJECTS += mTVolca.o
180 OBJECTS += Phone.o
181 OBJECTS += PhoneCollection.o
182 OBJECTS += Phonology.o
183 OBJECTS += POS.o
184 OBJECTS += POSCollection.o
185 OBJECTS += preferencesdialog.o
186 OBJECTS += Prefix.o
187 OBJECTS += PrefixCollection.o
188 OBJECTS += propertiesdialog.o
189 OBJECTS += Sequencer.o
190 OBJECTS += Signature.o
191 OBJECTS += SignatureCollection.o
192 OBJECTS += SignatureCollection_PartsOfSpeech.o
193 OBJECTS += Slice.o
194 OBJECTS += SparseIntVector.o
195 OBJECTS += SparseVector.o
196 OBJECTS += StateEmitHMM.o
197 OBJECTS += Stats.o
198 OBJECTS += Stem.o
199 OBJECTS += Stem_EncodingLength.o
200 OBJECTS += Stem_Phonology.o
201 OBJECTS += StemCollection.o
202 OBJECTS += StemListViewItem.o
203 OBJECTS += StringEditGrid.o
204 OBJECTS += Suffix.o
205 OBJECTS += SuffixCollection.o
206 OBJECTS += Template.o
207 OBJECTS += TemplateCollection.o
208 OBJECTS += TerminalRuleCollection.o
209 OBJECTS += TreeViewItem.o
210 OBJECTS += Trie.o
211 OBJECTS += verifydialog.o
212 OBJECTS += Version.o
213 OBJECTS += VeryLong.o
214 OBJECTS += Word.o
215 OBJECTS += WordCollection.o
217 include string/Makefile
218 include ui/Makefile
219 include gui/Makefile
221 OBJECTS += moc_canvasdialog.o
222 OBJECTS += moc_corpusviewdialog.o
223 OBJECTS += moc_exportwizard.o
224 OBJECTS += moc_GraphicView.o
225 OBJECTS += moc_helpaboutdialog.o
226 OBJECTS += moc_linepropertiesdialog.o
227 OBJECTS += moc_linguisticamainwindow.o
228 OBJECTS += moc_listbuilderdialog.o
229 OBJECTS += moc_preferencesdialog.o
230 OBJECTS += moc_propertiesdialog.o
231 OBJECTS += moc_verifydialog.o
233 OBJECTS += qrc_linguistica.o
235 RESOURCES += images/splash.png
236 RESOURCES += images/new.xpm
237 RESOURCES += images/reload.xpm
238 RESOURCES += images/save.xpm
239 RESOURCES += images/open.xpm
240 RESOURCES += images/favicon.xpm
242 ifeq ($(V),1)
243 quiet_link =
244 quiet_compile =
245 quiet_metaobject =
246 quiet_resource =
247 quiet_uiheader =
248 else
249 quiet_link = @echo " LINK" $@ &&
250 quiet_compile = @echo " CXX" $@ &&
251 quiet_metaobject = @echo " MOC" $@ &&
252 quiet_resource = @echo " RCC" $@ &&
253 quiet_uiheader = @echo " UIC" $@ &&
254 endif
256 linguistica: $(OBJECTS)
257 $(quiet_link) $(CXX) -o $@ $(OBJECTS) $(ALL_LDFLAGS) $(LIBS)
259 dep_file = $(dir $@).$(notdir $@).d
260 dep_args = -MF $(dep_file) -MMD -MP
262 %.o: %.cpp
263 $(quiet_compile) $(CXX) -c $< -o $@ $(dep_args) $(ALL_CFLAGS)
265 dep_files := $(wildcard .*.d)
266 ifneq ($(dep_files),)
267 include $(dep_files)
268 endif
270 moc_%.cpp: %.h
271 $(quiet_metaobject) $(MOC) -o $@ $<
273 qrc_linguistica.cpp: images/linguistica.qrc $(RESOURCES)
274 $(quiet_resource) $(RCC) -o $@ $< -name linguistica
276 $(OBJECTS): ui_canvasdialogbase.h
277 $(OBJECTS): ui_corpusviewdialogbase.h
278 $(OBJECTS): ui_exportwizardbase.h
279 $(OBJECTS): ui_helpaboutdialogbase.h
280 $(OBJECTS): ui_linepropertiesdialogbase.h
281 $(OBJECTS): ui_linguisticamainwindowbase.h
282 $(OBJECTS): ui_listbuilderdialogbase.h
283 $(OBJECTS): ui_preferencesdialogbase.h
284 $(OBJECTS): ui_propertiesdialogbase.h
285 $(OBJECTS): ui_verifydialogbase.h
287 ui_%.h: %.ui
288 $(quiet_uiheader) $(UIC) -o $@ $<
290 linguistica.app: linguistica macosx/Info.plist macosx/linguistica.icns
291 rm -rf $@ $@+
292 mkdir -p $@+/Contents/MacOS
293 mkdir -p $@+/Contents/Resources
294 cp macosx/Info.plist $@+/Contents
295 cp macosx/linguistica.icns $@+/Contents/Resources
296 cp linguistica $@+/Contents/MacOS
297 mv $@+ $@
299 clean::
300 rm -f .*.o.d
301 rm -f *.o
302 rm -f ui_*.h
303 rm -f moc_*.cpp
304 rm -f qrc_*.cpp
305 rm -f linguistica
306 rm -rf linguistica.app linguistica.app+
308 .PHONY: all clean