Salome HOME
69822e43700fd56ac7b2fc836006c5443a05c560
[modules/gui.git] / adm_local / unix / make_conclude.in
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #=======================================================================
23 # This section of this makefile comes from the file 
24 # 'adm/unix/make_conclude' which was generated with config.status
25 # from file adm/unix/make_conclude.in
26 #=======================================================================
27 # -* Makefile *- 
28 # Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
29 # Date : 6/07/2001
30 # $Header$
31 #
32 ifneq ($(GUI_DISABLE_CORBA),yes)
33 # ORB Specifics rules
34
35 @CORBA@
36
37 # transform idl reference in appropriate obj file
38 LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
39 LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
40 LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx)
41 else
42 LIB_CLIENT_SRC = 
43 LIB_SERVER_SRC = 
44 LIB_SWIG_SRC = 
45 endif
46
47 LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx)
48 LIB_SRC+=$(LIB_MOC_SRC)
49 LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC)
50  
51 ifneq ($(GUI_DISABLE_CORBA),yes)
52 LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
53 LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
54 LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
55 else
56 LIB_CLIENT_OBJ = 
57 LIB_SERVER_OBJ = 
58 LIB_SWIG_OBJ = 
59 endif
60  
61 # transform c file in appropriate libtool obj file (.c, .cc and .cxx)
62 LIB_OBJ_C   = $(patsubst %.c,   %.lo, $(filter %.c, $(LIB_SRC))) 
63 LIB_OBJ_CC  = $(patsubst %.cc,  %.lo, $(filter %.cc, $(LIB_SRC))) 
64 LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC))) 
65 LIB_OBJ_F    = $(patsubst %.f,   %.lo, $(filter %.f, $(LIB_SRC))) 
66
67 # all libtool obj file in library
68 LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F)
69
70 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
71 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
72 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
73 LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
74
75 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
76 ifneq ($(GUI_DISABLE_CORBA),yes)
77 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
78 else
79 LIB_SWIG = 
80 endif
81 else
82 LIB_SWIG = 
83 endif
84
85 lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
86 # we don't build static library !
87
88 $(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
89         -$(RM) $@
90         -$(RM) $(patsubst %.la, %.so, $@)
91         -$(RM) $(patsubst %.la, %.a, $@)
92         ln -sf $(CURDIR)/$< $@ || true
93         ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
94               $(patsubst %.la, %.so, $@) || true
95         ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
96               $(patsubst %.la, %.so, $@).0 || true
97
98         if ! test -z $(LIB_SWIG) ; then \
99            ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
100         fi;
101
102 $(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
103         -$(RM) $@
104         ln -sf $(CURDIR)/$< $@ || true
105
106 $(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
107         -$(RM) $@
108         ln -sf $(CURDIR)/$< $@ || true
109
110 $(LIB): $(LIB_OBJ)
111         @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
112
113 # transform idl reference in appropriate obj file
114 ifneq ($(GUI_DISABLE_CORBA),yes)
115 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
116 BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
117 else
118 BIN_CLIENT_SRC = 
119 BIN_SERVER_SRC = 
120 endif
121 BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
122 BIN_SRC+=$(BIN_MOC_SRC)
123 BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
124
125 ifneq ($(GUI_DISABLE_CORBA),yes)
126 BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
127 BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) 
128 else
129 BIN_CLIENT_OBJ = 
130 BIN_SERVER_OBJ = 
131 endif
132 # transform c file in appropriate libtool obj file (.c)
133 BIN_OBJ_C =  $(patsubst %.c,  %.o, $(filter %.c, $(BIN_SRC)))
134 # transform c++ file in appropriate libtool obj file (.cc and .cxx)
135 BIN_OBJ_CC = $(patsubst %.cc,  %.o, $(filter %.cc, $(BIN_SRC)))
136 BIN_OBJ_CXX = $(patsubst %.cxx,  %.o, $(filter %.cxx, $(BIN_SRC)))
137 # all obj file in bin target
138 BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ) 
139
140 bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
141
142 BIN_LIB=$(LIB:lib%.la=-l%)
143
144 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
145         -$(RM) $@
146         ln -sf $(CURDIR)/$< $@
147
148 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
149         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
150
151 # copy python scripts in $(top_builddir)/bin/salome
152 #
153
154 UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
155 UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
156 UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
157
158 DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
159 DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
160 pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
161 $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
162         cp -f $< $@
163
164 # generate generic python scripts from *.ui files
165 #
166 $(UI_PY_FILES): %.py: %.ui
167         $(PYUIC) $< -o $@
168
169 # copy ui-generated python scripts in $(top_builddir)/bin
170 #
171 $(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
172         cp -f $< $@
173
174 # copy pyqt files in $(PYTHON_SHARED_SITE)
175 #
176 PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
177
178 $(PYTHON_SHARED_SITE):
179         $(INSTALL) -d  $@
180
181 DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
182 sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
183 $(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
184         cp -f $< $@
185
186 check: test
187
188 tests: unittest
189
190 test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%) 
191
192 unittest: 
193         @if test "x$(UNIT_TEST_PROG)" != "x"; then      \
194            $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
195         fi;
196
197 # copy header file in $(inc_builddir)
198 #
199 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
200 inc: $(DEST_HEADERS)
201 $(DEST_HEADERS): $(inc_builddir)/%: %
202         cp -f $< $@
203
204 # build resources file (icons and messages) : .qm file from .po file
205 RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
206 RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
207 RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
208 RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
209 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
210
211 resources: resources-po resources-cp 
212
213 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
214
215 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
216
217 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
218         cp -fr $< $@;
219
220 # Make installation directories if they don't exist.
221 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
222         $(INSTALL) -d $@ && chmod 755 $@
223
224 # Install the library, the public header files, and programs.
225 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
226         @for f in X $(LIB); do                                                \
227            if test $$f != X; then                                             \
228               ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1);                  \
229            fi;                                                                \
230         done
231         @if ! test -z $(LIB_SWIG) ; then                                      \
232           (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG)  || true); \
233         fi;                                                                   
234         @for f in X $(BIN); do                                                \
235            if test $$f != X; then                                             \
236              ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
237            fi;                                                                \
238         done
239 # Install tests programmes in bindir
240         @for f in X $(TEST_PROGS); do                                         \
241            if test $$f != X; then                                             \
242              ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
243            fi;                                                                \
244         done
245 # Install exported includes in includedir
246         @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do                       \
247            if test $$f != X; then                                             \
248              (cp -p -f $$f $(includedir) || exit 1);                          \
249            fi;                                                                \
250         done
251
252 # Install python script in $(bindir)
253 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
254
255 $(UI_PY_FILES:%=install-%): install-%: %
256         $(INSTALL_PROGRAM) $< $(bindir)/.
257
258 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
259         $(INSTALL_PROGRAM) $< $(bindir)/.
260
261 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
262 #       @for f in X $(EXPORT_PYSCRIPTS); do                           \
263 #          if test $$f != X; then                                     \
264 #            ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1);          \
265 #          fi;                                                        \
266 #       done
267
268 # Install pyqt script in $(install-sharedpyqt)
269 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%) 
270
271 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
272         $(INSTALL_PROGRAM) $< $(sharedpydir)/.
273
274
275 # generic rule to install .qm files :
276 install-qm: resources
277         $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
278         @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
279            if test $$f != X; then                                                        \
280              ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1);                      \
281            fi;                                                                           \
282         done
283
284 # generic rule to install resources files (png, ini ...):
285 install-res: resources
286         $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
287         @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
288            if test $$f != X; then                                                        \
289              ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1);                      \
290            fi;                                                                           \
291         done  
292
293 # Removes those things that `make install' (would have) installed.
294 uninstall:
295         @if test "X$(LIB)" != X; then                                         \
296            for f in $(LIB); do                                                \
297               $(LT_UNINSTALL) $(libdir)/$$f;                                  \
298            done;                                                              \
299         fi
300         @if test "X$(BIN)" != X; then                                         \
301            for f in $(BIN); do                                                \
302               $(LT_UNINSTALL) $(bindir)/$$f;                                  \
303            done;                                                              \
304         fi
305         @for f in X $(TEST_PROGS); do                                         \
306            if test $$f != X; then                                             \
307              $(LT_UNINSTALL) $(bindir)/$$f;                                   \
308            fi;                                                                \
309         done
310 # Uninstall exported includes in includedir
311         @for f in X $(EXPORT_HEADERS); do                                     \
312            if test $$f != X; then                                             \
313              $(LT_UNINSTALL) $(includedir)/$$f;                               \
314            fi;                                                                \
315         done
316 # Uninstall python script in $(bindir)
317         @for f in X $(EXPORT_PYSCRIPTS); do                                   \
318            if test $$f != X; then                                             \
319              $(LT_UNINSTALL) $(bindir)/$$f ;                  \
320            fi;                                                                \
321         done
322
323 # Uninstall python script in $(bindir)
324         @for f in X $(UI_PY_FILES); do                                        \
325            if test $$f != X; then                                             \
326              $(LT_UNINSTALL) $(bindir)/$$f ;                  \
327            fi;                                                                \
328         done
329
330 # Uninstall pyqt script in $(sharedpydir)
331         @for f in X $(EXPORT_SHAREDPYSCRIPTS); do                                     \
332            if test $$f != X; then                                             \
333              $(LT_UNINSTALL) $(sharedpydir)/$$f ;                     \
334            fi;                                                                \
335         done
336
337 # Uninstall qm files
338         @for f in X $(PO_FILES:%.po=%.qm); do         \
339            if test $$f != X; then                                             \
340              $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ;                        \
341            fi;                                                                \
342         done
343
344 # remove all dependencies files
345 #
346 cleandep:
347         -$(RM) .dep*
348
349 # Removes temporary files without removing the final target files.  That is,
350 # remove things like object files but not libraries or executables.
351 #
352 mostlyclean: cleandep
353         -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
354         -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
355         -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
356         -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
357
358 # Like `mostlyclean' except it also removes the final targets: things like
359 # libraries and executables.  This target doesn't remove any file that
360 # is part of the SALOME distribution.
361 #
362 clean: mostlyclean
363         -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
364         -$(RM) TAGS *~ *# core *.core 
365         -$(RM) -r .libs
366         -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
367         -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
368         -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
369         -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
370 # remove idl generated files (sources)
371         -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
372 # remove idl generated files (headers)
373         -$(RM)  $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
374         -$(RM)  $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
375         -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
376         -$(RM) $(LIB_SWIG_SRC)
377
378 # Like `clean' except it also removes files that were created by running
379 # configure.  If you've unpacked the source and built without creating
380 # any other files, then `make distclean' will leave only the files that were
381 # in the distribution.
382 #
383 distclean: clean
384         #remove qm file !
385         -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
386         #remove include files
387         -$(RM) $(DEST_HEADERS)
388         -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
389         @if test -f $(srcdir)/Makefile.in; then                               \
390            (@SETX@; $(RM) Makefile);                                          \
391         fi
392
393
394 #implicits rules
395 .cc.o:
396         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
397
398 .cc.lo:
399         $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
400
401 .cxx.o:
402         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
403
404 .cxx.lo:
405         $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
406
407 .c.o:
408         $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
409
410 .c.lo:
411         $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
412
413 .f.o:
414         $(FC) $(FFLAGS) -c $< -o $@
415
416 .f.lo:
417         $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
418
419 .ui.h:
420         $(UIC) -o $@  $<
421
422 .ui.cxx:
423         $(UIC) -o $@ -i $*.h $<
424
425 #pattern rules
426 %_moc.cxx : %.h
427         $(MOC) $< -o $@
428
429 %_wrap.cxx : %.i
430         $(SWIG) $(SWIG_FLAGS) -o $@ $<
431
432 $(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
433         $(MSG2QM) $< $@ ; \
434
435 #------------------------------------------------------------------------------
436 # The following section of this makefile contains dependencies between the
437 # source files and the header files.  If GNU make and GCC are being used then
438 # the dependencies are in the form of rules that cause the information to
439 # be kept updated automatically.  Otherwise the dependencies are listed
440 # explicitly and come from the `.distdep' files in the various directories.
441 # These files are part of the distribution and are generated automatically on
442 # GNU/GCC systems.
443 #------------------------------------------------------------------------------
444
445 @DEPEND@