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