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 #=======================================================================
8 # Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
13 ifneq ($(GUI_DISABLE_CORBA),yes)
18 # transform idl reference in appropriate obj file
19 LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
20 LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
21 LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx)
28 LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx)
29 LIB_SRC+=$(LIB_MOC_SRC)
30 LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC)
32 ifneq ($(GUI_DISABLE_CORBA),yes)
33 LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
34 LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
35 LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
42 # transform c file in appropriate libtool obj file (.c, .cc and .cxx)
43 LIB_OBJ_C = $(patsubst %.c, %.lo, $(filter %.c, $(LIB_SRC)))
44 LIB_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(LIB_SRC)))
45 LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC)))
46 LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC)))
48 # all libtool obj file in library
49 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)
51 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
52 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
53 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
54 LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
56 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
57 ifneq ($(GUI_DISABLE_CORBA),yes)
58 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
66 lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
67 # we don't build static library !
69 $(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
71 -$(RM) $(patsubst %.la, %.so, $@)
72 -$(RM) $(patsubst %.la, %.a, $@)
73 ln -sf $(CURDIR)/$< $@ || true
74 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
75 $(patsubst %.la, %.so, $@) || true
76 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
77 $(patsubst %.la, %.so, $@).0 || true
79 if ! test -z $(LIB_SWIG) ; then \
80 ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
83 $(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
85 ln -sf $(CURDIR)/$< $@ || true
87 $(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
89 ln -sf $(CURDIR)/$< $@ || true
92 @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
94 # transform idl reference in appropriate obj file
95 ifneq ($(GUI_DISABLE_CORBA),yes)
96 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
97 BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
102 BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
103 BIN_SRC+=$(BIN_MOC_SRC)
104 BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
106 ifneq ($(GUI_DISABLE_CORBA),yes)
107 BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
108 BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
113 # transform c file in appropriate libtool obj file (.c)
114 BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC)))
115 # transform c++ file in appropriate libtool obj file (.cc and .cxx)
116 BIN_OBJ_CC = $(patsubst %.cc, %.o, $(filter %.cc, $(BIN_SRC)))
117 BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC)))
118 # all obj file in bin target
119 BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ)
121 bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
123 BIN_LIB=$(LIB:lib%.la=-l%)
125 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
127 ln -sf $(CURDIR)/$< $@
129 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
130 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
132 # copy python scripts in $(top_builddir)/bin/salome
135 UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
136 UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
137 UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
139 DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
140 DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
141 pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
142 $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
145 # generate generic python scripts from *.ui files
147 $(UI_PY_FILES): %.py: %.ui
150 # copy ui-generated python scripts in $(top_builddir)/bin
152 $(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
155 # copy pyqt files in $(PYTHON_SHARED_SITE)
157 PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
159 $(PYTHON_SHARED_SITE):
162 DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
163 sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
164 $(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
171 test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%)
174 @if test "x$(UNIT_TEST_PROG)" != "x"; then \
175 $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
178 # copy header file in $(inc_builddir)
180 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
182 $(DEST_HEADERS): $(inc_builddir)/%: %
185 # build resources file (icons and messages) : .qm file from .po file
186 RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
187 RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
188 RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
189 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
191 resources: resources-po resources-cp
193 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
195 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
197 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
200 # Make installation directories if they don't exist.
201 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
202 $(INSTALL) -d $@ && chmod 755 $@
204 # Install the library, the public header files, and programs.
205 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
206 @for f in X $(LIB); do \
207 if test $$f != X; then \
208 ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
211 @if ! test -z $(LIB_SWIG) ; then \
212 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
214 @for f in X $(BIN); do \
215 if test $$f != X; then \
216 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
219 # Install tests programmes in bindir
220 @for f in X $(TEST_PROGS); do \
221 if test $$f != X; then \
222 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
225 # Install exported includes in includedir
226 @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
227 if test $$f != X; then \
228 (cp -p -f $$f $(includedir) || exit 1); \
232 # Install python script in $(bindir)
233 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
235 $(UI_PY_FILES:%=install-%): install-%: %
236 $(INSTALL_PROGRAM) $< $(bindir)/.
238 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
239 $(INSTALL_PROGRAM) $< $(bindir)/.
241 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
242 # @for f in X $(EXPORT_PYSCRIPTS); do \
243 # if test $$f != X; then \
244 # ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
248 # Install pyqt script in $(install-sharedpyqt)
249 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
251 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
252 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
255 # generic rule to install .qm files :
256 install-qm: resources
257 $(INSTALL) -d $(datadir)/resources
258 @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
259 if test $$f != X; then \
260 ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
264 # generic rule to install resources files (png, ini ...):
265 install-res: resources
266 $(INSTALL) -d $(datadir)/resources
267 @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \
268 if test $$f != X; then \
269 ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
273 # Removes those things that `make install' (would have) installed.
275 @if test "X$(LIB)" != X; then \
276 for f in $(LIB); do \
277 $(LT_UNINSTALL) $(libdir)/$$f; \
280 @if test "X$(BIN)" != X; then \
281 for f in $(BIN); do \
282 $(LT_UNINSTALL) $(bindir)/$$f; \
285 @for f in X $(TEST_PROGS); do \
286 if test $$f != X; then \
287 $(LT_UNINSTALL) $(bindir)/$$f; \
290 # Uninstall exported includes in includedir
291 @for f in X $(EXPORT_HEADERS); do \
292 if test $$f != X; then \
293 $(LT_UNINSTALL) $(includedir)/$$f; \
296 # Uninstall python script in $(bindir)
297 @for f in X $(EXPORT_PYSCRIPTS); do \
298 if test $$f != X; then \
299 $(LT_UNINSTALL) $(bindir)/$$f ; \
303 # Uninstall python script in $(bindir)
304 @for f in X $(UI_PY_FILES); do \
305 if test $$f != X; then \
306 $(LT_UNINSTALL) $(bindir)/$$f ; \
310 # Uninstall pyqt script in $(sharedpydir)
311 @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
312 if test $$f != X; then \
313 $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
318 @for f in X $(PO_FILES:%.po=%.qm); do \
319 if test $$f != X; then \
320 $(LT_UNINSTALL) $(datadir)/resources/$$f ; \
324 # remove all dependencies files
329 # Removes temporary files without removing the final target files. That is,
330 # remove things like object files but not libraries or executables.
332 mostlyclean: cleandep
333 -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
334 -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
335 -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
336 -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
338 # Like `mostlyclean' except it also removes the final targets: things like
339 # libraries and executables. This target doesn't remove any file that
340 # is part of the SALOME distribution.
343 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
344 -$(RM) TAGS *~ *# core *.core
346 -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
347 -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
348 -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
349 -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
350 # remove idl generated files (sources)
351 -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
352 # remove idl generated files (headers)
353 -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
354 -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
355 -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
356 -$(RM) $(LIB_SWIG_SRC)
358 # Like `clean' except it also removes files that were created by running
359 # configure. If you've unpacked the source and built without creating
360 # any other files, then `make distclean' will leave only the files that were
361 # in the distribution.
365 -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
366 #remove include files
367 -$(RM) $(DEST_HEADERS)
368 -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
369 @if test -f $(srcdir)/Makefile.in; then \
370 (@SETX@; $(RM) Makefile); \
376 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
379 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
382 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
385 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
388 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
391 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
394 $(FC) $(FFLAGS) -c $< -o $@
397 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
403 $(UIC) -o $@ -i $*.h $<
410 $(SWIG) $(SWIG_FLAGS) -o $@ $<
412 $(top_builddir)/share/salome/resources/%.qm: %.po
415 #------------------------------------------------------------------------------
416 # The following section of this makefile contains dependencies between the
417 # source files and the header files. If GNU make and GCC are being used then
418 # the dependencies are in the form of rules that cause the information to
419 # be kept updated automatically. Otherwise the dependencies are listed
420 # explicitly and come from the `.distdep' files in the various directories.
421 # These files are part of the distribution and are generated automatically on
423 #------------------------------------------------------------------------------