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