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