Salome HOME
SMH: Fix for flags
[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 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: resources-po resources-cp 
156
157 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
158
159 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
160
161 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
162         cp -f $< $@
163
164 # Make installation directories if they don't exist.
165 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
166         $(INSTALL) -d $@ && chmod 755 $@
167
168 # Install the library, the public header files, and programs.
169 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
170         @for f in X $(LIB); do                                                \
171            if test $$f != X; then                                             \
172               ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1);                  \
173            fi;                                                                \
174         done
175         @if ! test -z $(LIB_SWIG) ; then                                      \
176           (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG)  || true); \
177         fi;                                                                   
178         @for f in X $(BIN); do                                                \
179            if test $$f != X; then                                             \
180              ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
181            fi;                                                                \
182         done
183 # Install tests programmes in bindir
184         @for f in X $(TEST_PROGS); do                                         \
185            if test $$f != X; then                                             \
186              ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
187            fi;                                                                \
188         done
189 # Install exported includes in includedir
190         @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do                       \
191            if test $$f != X; then                                             \
192              (cp -p -f $$f $(includedir) || exit 1);                          \
193            fi;                                                                \
194         done
195
196 # Install python script in $(bindir)
197 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
198
199 $(UI_PY_FILES:%=install-%): install-%: %
200         $(INSTALL_PROGRAM) $< $(bindir)/.
201
202 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
203         $(INSTALL_PROGRAM) $< $(bindir)/.
204
205 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
206 #       @for f in X $(EXPORT_PYSCRIPTS); do                           \
207 #          if test $$f != X; then                                     \
208 #            ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1);          \
209 #          fi;                                                        \
210 #       done
211
212 # Install pyqt script in $(install-sharedpyqt)
213 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%) 
214
215 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
216         $(INSTALL_PROGRAM) $< $(sharedpydir)/.
217
218
219 # generic rule to install .qm files :
220 install-qm: resources
221         $(INSTALL) -d $(datadir)/resources
222         @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
223            if test $$f != X; then                                                        \
224              ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1);                     \
225            fi;                                                                           \
226         done
227
228 # generic rule to install resources files (png, ini ...):
229 install-res: resources
230         $(INSTALL) -d $(datadir)/resources
231         @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \
232            if test $$f != X; then                                                        \
233              ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1);                     \
234            fi;                                                                           \
235         done  
236
237 # Removes those things that `make install' (would have) installed.
238 uninstall:
239         @if test "X$(LIB)" != X; then                                         \
240            for f in $(LIB); do                                                \
241               $(LT_UNINSTALL) $(libdir)/$$f;                                  \
242            done;                                                              \
243         fi
244         @if test "X$(BIN)" != X; then                                         \
245            for f in $(BIN); do                                                \
246               $(LT_UNINSTALL) $(bindir)/$$f;                                  \
247            done;                                                              \
248         fi
249         @for f in X $(TEST_PROGS); do                                         \
250            if test $$f != X; then                                             \
251              $(LT_UNINSTALL) $(bindir)/$$f;                                   \
252            fi;                                                                \
253         done
254 # Uninstall exported includes in includedir
255         @for f in X $(EXPORT_HEADERS); do                                     \
256            if test $$f != X; then                                             \
257              $(LT_UNINSTALL) $(includedir)/$$f;                               \
258            fi;                                                                \
259         done
260 # Uninstall python script in $(bindir)
261         @for f in X $(EXPORT_PYSCRIPTS); do                                   \
262            if test $$f != X; then                                             \
263              $(LT_UNINSTALL) $(bindir)/$$f ;                  \
264            fi;                                                                \
265         done
266
267 # Uninstall python script in $(bindir)
268         @for f in X $(UI_PY_FILES); do                                        \
269            if test $$f != X; then                                             \
270              $(LT_UNINSTALL) $(bindir)/$$f ;                  \
271            fi;                                                                \
272         done
273
274 # Uninstall pyqt script in $(sharedpydir)
275         @for f in X $(EXPORT_SHAREDPYSCRIPTS); do                                     \
276            if test $$f != X; then                                             \
277              $(LT_UNINSTALL) $(sharedpydir)/$$f ;                     \
278            fi;                                                                \
279         done
280
281 # Uninstall qm files
282         @for f in X $(PO_FILES:%.po=%.qm); do         \
283            if test $$f != X; then                                             \
284              $(LT_UNINSTALL) $(datadir)/resources/$$f ;                       \
285            fi;                                                                \
286         done
287
288 # remove all dependencies files
289 #
290 cleandep:
291         -$(RM) .dep*
292
293 # Removes temporary files without removing the final target files.  That is,
294 # remove things like object files but not libraries or executables.
295 #
296 mostlyclean: cleandep
297         -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
298         -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
299         -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
300         -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
301
302 # Like `mostlyclean' except it also removes the final targets: things like
303 # libraries and executables.  This target doesn't remove any file that
304 # is part of the SALOME distribution.
305 #
306 clean: mostlyclean
307         -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
308         -$(RM) TAGS *~ *# core *.core 
309         -$(RM) -r .libs
310         -$(RM) $(top_builddir)/lib/salome/$(LIB)
311         -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
312         -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib/salome/$(LIB))
313         -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib/salome/$(LIB))
314 # remove idl generated files (sources)
315         -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
316 # remove idl generated files (headers)
317         -$(RM)  $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
318         -$(RM)  $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
319         -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
320         -$(RM) $(LIB_SWIG_SRC)
321
322 # Like `clean' except it also removes files that were created by running
323 # configure.  If you've unpacked the source and built without creating
324 # any other files, then `make distclean' will leave only the files that were
325 # in the distribution.
326 #
327 distclean: clean
328         #remove qm file !
329         -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
330         #remove include files
331         -$(RM) $(DEST_HEADERS)
332         -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
333         @if test -f $(srcdir)/Makefile.in; then                               \
334            (@SETX@; $(RM) Makefile);                                          \
335         fi
336
337
338 #implicits rules
339 .cc.o:
340         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
341
342 .cc.lo:
343         $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
344
345 .cxx.o:
346         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
347
348 .cxx.lo:
349         $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
350
351 .c.o:
352         $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
353
354 .c.lo:
355         $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
356
357 .f.o:
358         $(FC) $(FFLAGS) -c $< -o $@
359
360 .f.lo:
361         $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
362
363 .ui.h:
364         $(UIC) -o $@  $<
365
366 .ui.cxx:
367         $(UIC) -o $@ -i $*.h $<
368
369 #pattern rules
370 %_moc.cxx : %.h
371         $(MOC) $< -o $@
372
373 %_wrap.cxx : %.i
374         $(SWIG) $(SWIG_FLAGS) -o $@ $<
375
376 $(top_builddir)/share/salome/resources/%.qm: %.po
377         $(MSG2QM) $< $@ ; \
378
379 #------------------------------------------------------------------------------
380 # The following section of this makefile contains dependencies between the
381 # source files and the header files.  If GNU make and GCC are being used then
382 # the dependencies are in the form of rules that cause the information to
383 # be kept updated automatically.  Otherwise the dependencies are listed
384 # explicitly and come from the `.distdep' files in the various directories.
385 # These files are part of the distribution and are generated automatically on
386 # GNU/GCC systems.
387 #------------------------------------------------------------------------------
388
389 @DEPEND@