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