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