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)
16 # transform idl reference in appropriate obj file
17 LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(LIB_CLIENT_IDL:%.idl=%DynSK.cc)
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)
24 LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(LIB_CLIENT_IDL:%.idl=%DynSK.o)
25 LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
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)))
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)
38 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
39 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
40 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
41 LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
43 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
44 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
49 lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
50 # we don't build static library !
52 $(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
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
62 if test "X$(LIB_SWIG)" != "X"; then \
63 ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
66 $(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
68 ln -sf $(CURDIR)/$< $@ || true
70 $(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
72 ln -sf $(CURDIR)/$< $@ || true
75 @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
77 # transform idl reference in appropriate obj file
78 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(BIN_CLIENT_IDL:%.idl=%DynSK.cc)
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)
84 BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(BIN_CLIENT_IDL:%.idl=%DynSK.o)
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)
94 bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
96 BIN_LIB=$(LIB:lib%.la=-l%)
98 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
100 ln -sf $(CURDIR)/$< $@
102 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
103 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
105 # copy python scripts in $(top_builddir)/bin/salome
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))
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/%: %
118 # generate generic python scripts from *.ui files
120 $(UI_PY_FILES): %.py: %.ui
123 # copy ui-generated python scripts in $(top_builddir)/bin
125 $(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
128 # copy pyqt files in $(PYTHON_SHARED_SITE)
130 PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
132 $(PYTHON_SHARED_SITE):
135 DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
136 sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
137 $(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
144 test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%)
147 @if test "x$(UNIT_TEST_PROG)" != "x"; then \
148 $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
151 # copy header file in $(inc_builddir)
153 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
155 $(DEST_HEADERS): $(inc_builddir)/%: %
158 # build resources file (icons and messages) : .qm file from .po file
159 RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
160 RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
161 RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
162 RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
163 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
165 resources: resources-po resources-cp
167 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
169 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
171 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
174 # Make installation directories if they don't exist.
175 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
176 $(INSTALL) -d $@ && chmod 755 $@
178 # Install the library, the public header files, and programs.
179 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
180 @for f in X $(LIB); do \
181 if test $$f != X; then \
182 ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
185 @if test "X$(LIB_SWIG)" != "X"; then \
186 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
188 @for f in X $(BIN); do \
189 if test $$f != X; then \
190 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
193 # Install tests programmes in bindir
194 @for f in X $(TEST_PROGS); do \
195 if test $$f != X; then \
196 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
199 # Install exported includes in includedir
200 @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
201 if test $$f != X; then \
202 (cp -p -f $$f $(includedir) || exit 1); \
206 # Install python script in $(bindir)
207 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
209 $(UI_PY_FILES:%=install-%): install-%: %
210 $(INSTALL_PROGRAM) $< $(bindir)/.
212 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
213 $(INSTALL_PROGRAM) $< $(bindir)/.
215 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
216 # @for f in X $(EXPORT_PYSCRIPTS); do \
217 # if test $$f != X; then \
218 # ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
222 # Install pyqt script in $(install-sharedpyqt)
223 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
225 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
226 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
229 # generic rule to install .qm files :
230 install-qm: resources
231 $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
232 @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
233 if test $$f != X; then \
234 ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
238 # generic rule to install resources files (png, ini ...):
239 install-res: resources
240 $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
241 @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
242 if test $$f != X; then \
243 ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
247 # Removes those things that `make install' (would have) installed.
249 @if test "X$(LIB)" != X; then \
250 for f in $(LIB); do \
251 $(LT_UNINSTALL) $(libdir)/$$f; \
254 @if test "X$(BIN)" != X; then \
255 for f in $(BIN); do \
256 $(LT_UNINSTALL) $(bindir)/$$f; \
259 @for f in X $(TEST_PROGS); do \
260 if test $$f != X; then \
261 $(LT_UNINSTALL) $(bindir)/$$f; \
264 # Uninstall exported includes in includedir
265 @for f in X $(EXPORT_HEADERS); do \
266 if test $$f != X; then \
267 $(LT_UNINSTALL) $(includedir)/$$f; \
270 # Uninstall python script in $(bindir)
271 @for f in X $(EXPORT_PYSCRIPTS); do \
272 if test $$f != X; then \
273 $(LT_UNINSTALL) $(bindir)/$$f ; \
277 # Uninstall python script in $(bindir)
278 @for f in X $(UI_PY_FILES); do \
279 if test $$f != X; then \
280 $(LT_UNINSTALL) $(bindir)/$$f ; \
284 # Uninstall pyqt script in $(sharedpydir)
285 @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
286 if test $$f != X; then \
287 $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
292 @for f in X $(PO_FILES:%.po=%.qm); do \
293 if test $$f != X; then \
294 $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \
298 # remove all dependencies files
303 # Removes temporary files without removing the final target files. That is,
304 # remove things like object files but not libraries or executables.
306 mostlyclean: cleandep
307 -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
308 -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
309 -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
310 -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
312 # Like `mostlyclean' except it also removes the final targets: things like
313 # libraries and executables. This target doesn't remove any file that
314 # is part of the SALOME distribution.
317 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
318 -$(RM) TAGS *~ *# core *.core
320 -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
321 -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
322 -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
323 -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
324 # remove idl generated files (sources)
325 -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
326 # remove idl generated files (headers)
327 -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
328 -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
329 -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
330 -$(RM) $(LIB_SWIG_SRC)
332 # Like `clean' except it also removes files that were created by running
333 # configure. If you've unpacked the source and built without creating
334 # any other files, then `make distclean' will leave only the files that were
335 # in the distribution.
339 -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
340 #remove include files
341 -$(RM) $(DEST_HEADERS)
342 -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
343 @if test -f $(srcdir)/Makefile.in; then \
344 (@SETX@; $(RM) Makefile); \
350 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
353 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
356 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
359 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
362 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
365 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
368 $(FC) $(FFLAGS) -c $< -o $@
371 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
377 $(UIC) -o $@ -i $*.h $<
384 $(SWIG) $(SWIG_FLAGS) -o $@ $<
386 $(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
389 #------------------------------------------------------------------------------
390 # The following section of this makefile contains dependencies between the
391 # source files and the header files. If GNU make and GCC are being used then
392 # the dependencies are in the form of rules that cause the information to
393 # be kept updated automatically. Otherwise the dependencies are listed
394 # explicitly and come from the `.distdep' files in the various directories.
395 # These files are part of the distribution and are generated automatically on
397 #------------------------------------------------------------------------------