1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #=======================================================================
23 # This section of this makefile comes from the file
24 # 'adm/unix/make_conclude' which was generated with config.status
25 # from file adm/unix/make_conclude.in
26 #=======================================================================
28 # Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
35 # transform idl reference in appropriate obj file
36 LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(LIB_CLIENT_IDL:%.idl=%DynSK.cc)
37 LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
38 LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx)
39 LIB_SRC+=$(LIB_MOC_SRC)
40 LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx)
41 LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC)
43 LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(LIB_CLIENT_IDL:%.idl=%DynSK.o)
44 LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
47 # transform c file in appropriate libtool obj file (.c, .cc and .cxx)
48 LIB_OBJ_C = $(patsubst %.c, %.lo, $(filter %.c, $(LIB_SRC)))
49 LIB_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(LIB_SRC)))
50 LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC)))
51 LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
52 LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC)))
54 # all libtool obj file in library
55 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 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
58 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
59 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
60 LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
62 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
63 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
68 lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
69 # we don't build static library !
71 $(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
73 -$(RM) $(patsubst %.la, %.so, $@)
74 -$(RM) $(patsubst %.la, %.a, $@)
75 ln -sf $(CURDIR)/$< $@ || true
76 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
77 $(patsubst %.la, %.so, $@) || true
78 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
79 $(patsubst %.la, %.so, $@).0 || true
81 if test "X$(LIB_SWIG)" != "X"; then \
82 ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
85 $(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
87 ln -sf $(CURDIR)/$< $@ || true
89 $(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
91 ln -sf $(CURDIR)/$< $@ || true
94 @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
96 # transform idl reference in appropriate obj file
97 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(BIN_CLIENT_IDL:%.idl=%DynSK.cc)
98 BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
99 BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
100 BIN_SRC+=$(BIN_MOC_SRC)
101 BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
103 BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(BIN_CLIENT_IDL:%.idl=%DynSK.o)
104 BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
105 # transform c file in appropriate libtool obj file (.c)
106 BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC)))
107 # transform c++ file in appropriate libtool obj file (.cc and .cxx)
108 BIN_OBJ_CC = $(patsubst %.cc, %.o, $(filter %.cc, $(BIN_SRC)))
109 BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC)))
110 # all obj file in bin target
111 BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ)
113 bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
115 BIN_LIB=$(LIB:lib%.la=-l%)
117 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
119 ln -sf $(CURDIR)/$< $@
121 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
122 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
124 # copy python scripts in $(top_builddir)/bin/salome
127 UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
128 UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
129 UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
131 DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
132 DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
133 pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
134 $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
137 # generate generic python scripts from *.ui files
139 $(UI_PY_FILES): %.py: %.ui
142 # copy ui-generated python scripts in $(top_builddir)/bin
144 $(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
147 # copy pyqt files in $(PYTHON_SHARED_SITE)
149 PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
151 $(PYTHON_SHARED_SITE):
154 DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
155 sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
156 $(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
163 test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%)
166 @if test "x$(UNIT_TEST_PROG)" != "x"; then \
167 $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
170 # copy header file in $(inc_builddir)
172 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
174 $(DEST_HEADERS): $(inc_builddir)/%: %
177 # build resources file (icons and messages) : .qm file from .po file
178 RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
179 RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
180 RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
181 RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
182 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
184 resources: resources-po resources-cp
186 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
188 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
190 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
193 # Make installation directories if they don't exist.
194 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
195 $(INSTALL) -d $@ && chmod 755 $@
197 # Install the library, the public header files, and programs.
198 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
199 @for f in X $(LIB); do \
200 if test $$f != X; then \
201 ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
204 @if test "X$(LIB_SWIG)" != "X"; then \
205 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
207 @for f in X $(BIN); do \
208 if test $$f != X; then \
209 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
212 # Install tests programmes in bindir
213 @for f in X $(TEST_PROGS); do \
214 if test $$f != X; then \
215 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
218 # Install exported includes in includedir
219 @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
220 if test $$f != X; then \
221 (cp -p -f $$f $(includedir) || exit 1); \
225 # Install python script in $(bindir)
226 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
228 $(UI_PY_FILES:%=install-%): install-%: %
229 $(INSTALL_PROGRAM) $< $(bindir)/.
231 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
232 $(INSTALL_PROGRAM) $< $(bindir)/.
234 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
235 # @for f in X $(EXPORT_PYSCRIPTS); do \
236 # if test $$f != X; then \
237 # ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
241 # Install pyqt script in $(install-sharedpyqt)
242 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
244 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
245 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
248 # generic rule to install .qm files :
249 install-qm: resources
250 $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
251 @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
252 if test $$f != X; then \
253 ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
257 # generic rule to install resources files (png, ini ...):
258 install-res: resources
259 $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
260 @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
261 if test $$f != X; then \
262 ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
266 # Removes those things that `make install' (would have) installed.
268 @if test "X$(LIB)" != X; then \
269 for f in $(LIB); do \
270 $(LT_UNINSTALL) $(libdir)/$$f; \
273 @if test "X$(BIN)" != X; then \
274 for f in $(BIN); do \
275 $(LT_UNINSTALL) $(bindir)/$$f; \
278 @for f in X $(TEST_PROGS); do \
279 if test $$f != X; then \
280 $(LT_UNINSTALL) $(bindir)/$$f; \
283 # Uninstall exported includes in includedir
284 @for f in X $(EXPORT_HEADERS); do \
285 if test $$f != X; then \
286 $(LT_UNINSTALL) $(includedir)/$$f; \
289 # Uninstall python script in $(bindir)
290 @for f in X $(EXPORT_PYSCRIPTS); do \
291 if test $$f != X; then \
292 $(LT_UNINSTALL) $(bindir)/$$f ; \
296 # Uninstall python script in $(bindir)
297 @for f in X $(UI_PY_FILES); do \
298 if test $$f != X; then \
299 $(LT_UNINSTALL) $(bindir)/$$f ; \
303 # Uninstall pyqt script in $(sharedpydir)
304 @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
305 if test $$f != X; then \
306 $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
311 @for f in X $(PO_FILES:%.po=%.qm); do \
312 if test $$f != X; then \
313 $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \
317 # remove all dependencies files
322 # Removes temporary files without removing the final target files. That is,
323 # remove things like object files but not libraries or executables.
325 mostlyclean: cleandep
326 -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
327 -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
328 -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
329 -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
331 # Like `mostlyclean' except it also removes the final targets: things like
332 # libraries and executables. This target doesn't remove any file that
333 # is part of the SALOME distribution.
336 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
337 -$(RM) TAGS *~ *# core *.core
339 -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
340 -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
341 -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
342 -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
343 # remove idl generated files (sources)
344 -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
345 # remove idl generated files (headers)
346 -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
347 -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
348 -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
349 -$(RM) $(LIB_SWIG_SRC)
351 # Like `clean' except it also removes files that were created by running
352 # configure. If you've unpacked the source and built without creating
353 # any other files, then `make distclean' will leave only the files that were
354 # in the distribution.
358 -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
359 #remove include files
360 -$(RM) $(DEST_HEADERS)
361 -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
362 @if test -f $(srcdir)/Makefile.in; then \
363 (@SETX@; $(RM) Makefile); \
369 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
372 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
375 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
378 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
381 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
384 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
387 $(FC) $(FFLAGS) -c $< -o $@
390 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
396 $(UIC) -o $@ -i $*.h $<
403 $(SWIG) $(SWIG_FLAGS) -o $@ $<
405 $(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
408 #------------------------------------------------------------------------------
409 # The following section of this makefile contains dependencies between the
410 # source files and the header files. If GNU make and GCC are being used then
411 # the dependencies are in the form of rules that cause the information to
412 # be kept updated automatically. Otherwise the dependencies are listed
413 # explicitly and come from the `.distdep' files in the various directories.
414 # These files are part of the distribution and are generated automatically on
416 #------------------------------------------------------------------------------