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_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
190 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
192 resources: resources-po resources-cp
194 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
196 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
198 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
201 # Make installation directories if they don't exist.
202 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
203 $(INSTALL) -d $@ && chmod 755 $@
205 # Install the library, the public header files, and programs.
206 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
207 @for f in X $(LIB); do \
208 if test $$f != X; then \
209 ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
212 @if ! test -z $(LIB_SWIG) ; then \
213 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
215 @for f in X $(BIN); do \
216 if test $$f != X; then \
217 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
220 # Install tests programmes in bindir
221 @for f in X $(TEST_PROGS); do \
222 if test $$f != X; then \
223 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
226 # Install exported includes in includedir
227 @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
228 if test $$f != X; then \
229 (cp -p -f $$f $(includedir) || exit 1); \
233 # Install python script in $(bindir)
234 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
236 $(UI_PY_FILES:%=install-%): install-%: %
237 $(INSTALL_PROGRAM) $< $(bindir)/.
239 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
240 $(INSTALL_PROGRAM) $< $(bindir)/.
242 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
243 # @for f in X $(EXPORT_PYSCRIPTS); do \
244 # if test $$f != X; then \
245 # ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
249 # Install pyqt script in $(install-sharedpyqt)
250 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
252 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
253 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
256 # generic rule to install .qm files :
257 install-qm: resources
258 $(INSTALL) -d $(datadir)/resources
259 @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
260 if test $$f != X; then \
261 ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
265 # generic rule to install resources files (png, ini ...):
266 install-res: resources
267 $(INSTALL) -d $(datadir)/resources
268 @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \
269 if test $$f != X; then \
270 ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
274 # Removes those things that `make install' (would have) installed.
276 @if test "X$(LIB)" != X; then \
277 for f in $(LIB); do \
278 $(LT_UNINSTALL) $(libdir)/$$f; \
281 @if test "X$(BIN)" != X; then \
282 for f in $(BIN); do \
283 $(LT_UNINSTALL) $(bindir)/$$f; \
286 @for f in X $(TEST_PROGS); do \
287 if test $$f != X; then \
288 $(LT_UNINSTALL) $(bindir)/$$f; \
291 # Uninstall exported includes in includedir
292 @for f in X $(EXPORT_HEADERS); do \
293 if test $$f != X; then \
294 $(LT_UNINSTALL) $(includedir)/$$f; \
297 # Uninstall python script in $(bindir)
298 @for f in X $(EXPORT_PYSCRIPTS); do \
299 if test $$f != X; then \
300 $(LT_UNINSTALL) $(bindir)/$$f ; \
304 # Uninstall python script in $(bindir)
305 @for f in X $(UI_PY_FILES); do \
306 if test $$f != X; then \
307 $(LT_UNINSTALL) $(bindir)/$$f ; \
311 # Uninstall pyqt script in $(sharedpydir)
312 @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
313 if test $$f != X; then \
314 $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
319 @for f in X $(PO_FILES:%.po=%.qm); do \
320 if test $$f != X; then \
321 $(LT_UNINSTALL) $(datadir)/resources/$$f ; \
325 # remove all dependencies files
330 # Removes temporary files without removing the final target files. That is,
331 # remove things like object files but not libraries or executables.
333 mostlyclean: cleandep
334 -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
335 -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
336 -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
337 -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
339 # Like `mostlyclean' except it also removes the final targets: things like
340 # libraries and executables. This target doesn't remove any file that
341 # is part of the SALOME distribution.
344 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
345 -$(RM) TAGS *~ *# core *.core
347 -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
348 -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
349 -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
350 -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
351 # remove idl generated files (sources)
352 -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
353 # remove idl generated files (headers)
354 -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
355 -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
356 -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
357 -$(RM) $(LIB_SWIG_SRC)
359 # Like `clean' except it also removes files that were created by running
360 # configure. If you've unpacked the source and built without creating
361 # any other files, then `make distclean' will leave only the files that were
362 # in the distribution.
366 -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
367 #remove include files
368 -$(RM) $(DEST_HEADERS)
369 -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
370 @if test -f $(srcdir)/Makefile.in; then \
371 (@SETX@; $(RM) Makefile); \
377 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
380 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
383 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
386 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
389 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
392 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
395 $(FC) $(FFLAGS) -c $< -o $@
398 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
404 $(UIC) -o $@ -i $*.h $<
411 $(SWIG) $(SWIG_FLAGS) -o $@ $<
413 $(top_builddir)/share/salome/resources/%.qm: %.po
416 #------------------------------------------------------------------------------
417 # The following section of this makefile contains dependencies between the
418 # source files and the header files. If GNU make and GCC are being used then
419 # the dependencies are in the form of rules that cause the information to
420 # be kept updated automatically. Otherwise the dependencies are listed
421 # explicitly and come from the `.distdep' files in the various directories.
422 # These files are part of the distribution and are generated automatically on
424 #------------------------------------------------------------------------------