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))
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))
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/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)))
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/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 -z $(LIB_SWIG) ; then \
63 ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\
66 $(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a
68 ln -sf $(CURDIR)/$< $@ || true
70 $(LIB_BUILD_SO): $(top_builddir)/lib/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))
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))
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/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 # copy header file in $(inc_builddir)
149 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
151 $(DEST_HEADERS): $(inc_builddir)/%: %
154 # build resources file (icons and messages) : .qm file from .po file
155 resources: resources-po resources-cp
157 resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
159 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
161 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
164 # Make installation directories if they don't exist.
165 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
166 $(INSTALL) -d $@ && chmod 755 $@
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); \
175 @if ! test -z $(LIB_SWIG) ; then \
176 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
178 @for f in X $(BIN); do \
179 if test $$f != X; then \
180 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
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); \
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); \
196 # Install python script in $(bindir)
197 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
199 $(UI_PY_FILES:%=install-%): install-%: %
200 $(INSTALL_PROGRAM) $< $(bindir)/.
202 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
203 $(INSTALL_PROGRAM) $< $(bindir)/.
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); \
212 # Install pyqt script in $(install-sharedpyqt)
213 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
215 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
216 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
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); \
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); \
237 # Removes those things that `make install' (would have) installed.
239 @if test "X$(LIB)" != X; then \
240 for f in $(LIB); do \
241 $(LT_UNINSTALL) $(libdir)/$$f; \
244 @if test "X$(BIN)" != X; then \
245 for f in $(BIN); do \
246 $(LT_UNINSTALL) $(bindir)/$$f; \
249 @for f in X $(TEST_PROGS); do \
250 if test $$f != X; then \
251 $(LT_UNINSTALL) $(bindir)/$$f; \
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; \
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 ; \
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 ; \
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 ; \
282 @for f in X $(PO_FILES:%.po=%.qm); do \
283 if test $$f != X; then \
284 $(LT_UNINSTALL) $(datadir)/resources/$$f ; \
288 # remove all dependencies files
293 # Removes temporary files without removing the final target files. That is,
294 # remove things like object files but not libraries or executables.
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)
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.
307 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
308 -$(RM) TAGS *~ *# core *.core
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)
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.
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); \
340 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
343 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
346 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
349 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
352 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
355 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
358 $(FC) $(FFLAGS) -c $< -o $@
361 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
367 $(UIC) -o $@ -i $*.h $<
374 $(SWIG) $(SWIG_FLAGS) -o $@ $<
376 $(top_builddir)/share/salome/resources/%.qm: %.po
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
387 #------------------------------------------------------------------------------