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))
27 # declare dependences between SWIG input files
28 $(LIB_SWIG_SRC): $(SWIG_DEP:%=$(inc_builddir)/%)
30 # transform c file in appropriate libtool obj file (.c, .cc and .cxx)
31 LIB_OBJ_C = $(patsubst %.c, %.lo, $(filter %.c, $(LIB_SRC)))
32 LIB_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(LIB_SRC)))
33 LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC)))
34 LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
35 LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC)))
37 # all libtool obj file in library
38 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)
40 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la)
41 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB)))
42 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB)))
44 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
45 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
50 lib: $(LIB_BUILD) $(LIB_CLIENT_PY)
51 # we don't build static library !
53 $(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la
55 -$(RM) $(patsubst %.la, %.so, $@)
56 -$(RM) $(patsubst %.la, %.a, $@)
57 ln -sf $(CURDIR)/$< $@ || true
58 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
59 $(patsubst %.la, %.so, $@) || true
60 ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
61 $(patsubst %.la, %.so, $@).0 || true
63 if test "X$(LIB_SWIG)" != X; then \
64 ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\
67 $(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a
69 ln -sf $(CURDIR)/$< $@ || true
72 @$(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
74 # transform idl reference in appropriate obj file
75 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
76 BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
77 BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
78 BIN_SRC+=$(BIN_MOC_SRC)
79 BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
81 BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
82 BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
83 # transform c file in appropriate libtool obj file (.c)
84 BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC)))
85 # transform c++ file in appropriate libtool obj file (.cc and .cxx)
86 BIN_OBJ_CC = $(patsubst %.cc, %.o, $(filter %.cc, $(BIN_SRC)))
87 BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC)))
88 # all obj file in bin target
89 BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ)
91 bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
93 BIN_LIB=$(LIB:lib%.la=-l%)
95 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
97 ln -sf $(CURDIR)/$< $@
99 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
100 $(CXX) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
102 # copy python scripts in $(top_builddir)/bin/salome
104 DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
105 pyscripts: $(DEST_PYSCRIPTS)
106 $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
109 # copy pyqt files in $(PYTHON_SHARED_SITE)
111 PYTHON_SHARED_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
113 $(PYTHON_SHARED_SITE):
116 DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
117 sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
118 $(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
125 test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%)
128 # copy header file in $(inc_builddir)
130 DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
132 $(DEST_HEADERS): $(inc_builddir)/%: %
135 # build resources file (icons and messages) : .qm file from .po file
136 resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
138 # Make installation directories if they don't exist.
139 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
140 $(INSTALL) -d $@ && chmod 755 $@
142 # Install the library, the public header files, and programs.
143 install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm
144 @for f in X $(LIB); do \
145 if test $$f != X; then \
146 ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
149 @if test "X$(LIB_SWIG)" != X ; then \
150 (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
152 @for f in X $(BIN); do \
153 if test $$f != X; then \
154 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
157 # Install tests programmes in bindir
158 @for f in X $(TEST_PROGS); do \
159 if test $$f != X; then \
160 ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
163 # Install exported includes in includedir
164 @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
165 if test $$f != X; then \
166 (cp -p -f $$f $(includedir) || exit 1); \
170 # Install python script in $(bindir)
171 install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%)
173 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
174 $(INSTALL_PROGRAM) $< $(bindir)/.
176 #install-python: $(bindir) $(EXPORT_PYSCRIPTS)
177 # @for f in X $(EXPORT_PYSCRIPTS); do \
178 # if test $$f != X; then \
179 # ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
183 # Install pyqt script in $(install-sharedpyqt)
184 install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
186 $(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
187 $(INSTALL_PROGRAM) $< $(sharedpydir)/.
190 # generic rule to install .qm files :
191 install-qm: resources
192 $(INSTALL) -d $(datadir)/resources
193 @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
194 if test $$f != X; then \
195 ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
199 # Removes those things that `make install' (would have) installed.
201 @if test "X$(LIB)" != X; then \
202 for f in $(LIB); do \
203 $(LT_UNINSTALL) $(libdir)/$$f; \
206 @if test "X$(BIN)" != X; then \
207 for f in $(BIN); do \
208 $(LT_UNINSTALL) $(bindir)/$$f; \
211 @for f in X $(TEST_PROGS); do \
212 if test $$f != X; then \
213 $(LT_UNINSTALL) $(bindir)/$$f; \
216 # Uninstall exported includes in includedir
217 @for f in X $(EXPORT_HEADERS); do \
218 if test $$f != X; then \
219 $(LT_UNINSTALL) $(includedir)/$$f; \
222 # Uninstall python script in $(bindir)
223 @for f in X $(EXPORT_PYSCRIPTS); do \
224 if test $$f != X; then \
225 $(LT_UNINSTALL) $(bindir)/$$f ; \
229 # Uninstall pyqt script in $(sharedpydir)
230 @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
231 if test $$f != X; then \
232 $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
237 @for f in X $(PO_FILES:%.po=%.qm); do \
238 if test $$f != X; then \
239 $(LT_UNINSTALL) $(datadir)/resources/$$f ; \
243 # remove all dependencies files
248 # Removes temporary files without removing the final target files. That is,
249 # remove things like object files but not libraries or executables.
251 mostlyclean: cleandep
252 -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
253 -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
254 -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
255 -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
257 # Like `mostlyclean' except it also removes the final targets: things like
258 # libraries and executables. This target doesn't remove any file that
259 # is part of the SALOME distribution.
262 -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
263 -$(RM) TAGS *~ *# core *.core
265 -$(RM) $(top_builddir)/lib/salome/$(LIB)
266 -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
267 -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib/salome/$(LIB))
268 -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib/salome/$(LIB))
269 # remove idl generated files (sources)
270 -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
271 # remove idl generated files (headers)
272 -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
273 -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
274 -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
275 -$(RM) $(LIB_SWIG_SRC)
277 # Like `clean' except it also removes files that were created by running
278 # configure. If you've unpacked the source and built without creating
279 # any other files, then `make distclean' will leave only the files that were
280 # in the distribution.
284 -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
285 #remove include files
286 -$(RM) $(DEST_HEADERS)
287 -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
288 @if test -f $(srcdir)/Makefile.in; then \
289 (@SETX@; $(RM) Makefile); \
295 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
298 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
301 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
304 $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
307 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
310 $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
313 $(FC) $(FFLAGS) -c $< -o $@
316 $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
322 $(UIC) -o $@ -i $*.h $<
329 $(SWIG) $(SWIG_FLAGS) -o $@ $<
331 $(top_builddir)/share/salome/resources/%.qm: %.po
334 #------------------------------------------------------------------------------
335 # The following section of this makefile contains dependencies between the
336 # source files and the header files. If GNU make and GCC are being used then
337 # the dependencies are in the form of rules that cause the information to
338 # be kept updated automatically. Otherwise the dependencies are listed
339 # explicitly and come from the `.distdep' files in the various directories.
340 # These files are part of the distribution and are generated automatically on
342 #------------------------------------------------------------------------------