Salome HOME
ENV: Windows porting.
[modules/kernel.git] / salome_adm / unix / make_conclude.in
index e8400bcaffd777e10abface05d8ceac7094647b6..227bf1634f2d5c379073b22468df3dd4272698e5 100644 (file)
@@ -38,6 +38,7 @@ LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $
 # LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la)
 LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB)))
 LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB)))
+LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib/salome/%.so, $(filter %.so, $(LIB)))
 
 ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
 LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
@@ -45,29 +46,33 @@ else
 LIB_SWIG = 
 endif
 
-lib: $(LIB_BUILD) $(LIB_CLIENT_PY)
+lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
 # we don't build static library !
 
 $(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la
        -$(RM) $@
        -$(RM) $(patsubst %.la, %.so, $@)
        -$(RM) $(patsubst %.la, %.a, $@)
-       ln -s $(CURDIR)/$< $@ || true
-       ln -s $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
+       ln -sf $(CURDIR)/$< $@ || true
+       ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
              $(patsubst %.la, %.so, $@) || true
-       ln -s $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
+       ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
              $(patsubst %.la, %.so, $@).0 || true
 
        if ! test -z $(LIB_SWIG) ; then \
-          ln -s $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\
+          ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\
        fi;
 
 $(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a
        -$(RM) $@
-       ln -s $(CURDIR)/$< $@ || true
+       ln -sf $(CURDIR)/$< $@ || true
+
+$(LIB_BUILD_SO): $(top_builddir)/lib/salome/%.so: %.so
+       -$(RM) $@
+       ln -sf $(CURDIR)/$< $@ || true
 
 $(LIB): $(LIB_OBJ)
-       @$(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
+       @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
 
 # transform idl reference in appropriate obj file
 BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
@@ -92,18 +97,34 @@ BIN_LIB=$(LIB:lib%.la=-l%)
 
 $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
        -$(RM) $@
-       ln -s $(CURDIR)/$< $@
+       ln -sf $(CURDIR)/$< $@
 
 $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
-       $(CXX) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGS) $(LIBS)
+       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
 
 # copy python scripts in $(top_builddir)/bin/salome
 #
+
+UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
+UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
+UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
+
 DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
-pyscripts: $(DEST_PYSCRIPTS)
+DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
+pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
 $(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
        cp -f $< $@
 
+# generate generic python scripts from *.ui files
+#
+$(UI_PY_FILES): %.py: %.ui
+       $(PYUIC) $< -o $@
+
+# copy ui-generated python scripts in $(top_builddir)/bin
+#
+$(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
+       cp -f $< $@
+
 # copy pyqt files in $(PYTHON_SHARED_SITE)
 #
 PYTHON_SHARED_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
@@ -131,21 +152,28 @@ $(DEST_HEADERS): $(inc_builddir)/%: %
        cp -f $< $@
 
 # build resources file (icons and messages) : .qm file from .po file
-resources: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
+resources: resources-po resources-cp 
+
+resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
+
+resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
+
+$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
+       cp -f $< $@
 
 # Make installation directories if they don't exist.
 $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
        $(INSTALL) -d $@ && chmod 755 $@
 
 # Install the library, the public header files, and programs.
-install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm
+install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
        @for f in X $(LIB); do                                                \
           if test $$f != X; then                                             \
              ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1);                  \
           fi;                                                                \
        done
        @if ! test -z $(LIB_SWIG) ; then                                      \
-         (cd $(libdir); ln -s $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG)  || true); \
+         (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG)  || true); \
         fi;                                                                  
        @for f in X $(BIN); do                                                \
           if test $$f != X; then                                             \
@@ -161,12 +189,15 @@ install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir
 # Install exported includes in includedir
        @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do                       \
           if test $$f != X; then                                             \
-            ($(INSTALL_DATA) $$f $(includedir)/. || exit 1);                 \
+            (cp -p -f $$f $(includedir) || exit 1);                          \
           fi;                                                                \
        done
 
 # Install python script in $(bindir)
-install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%)
+install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
+
+$(UI_PY_FILES:%=install-%): install-%: %
+       $(INSTALL_PROGRAM) $< $(bindir)/.
 
 $(EXPORT_PYSCRIPTS:%=install-%): install-%: %
        $(INSTALL_PROGRAM) $< $(bindir)/.
@@ -194,6 +225,15 @@ install-qm: resources
           fi;                                                                           \
        done
 
+# generic rule to install resources files (png, ini ...):
+install-res: resources
+       $(INSTALL) -d $(datadir)/resources
+       @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \
+          if test $$f != X; then                                                        \
+            ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1);                     \
+          fi;                                                                           \
+       done  
+
 # Removes those things that `make install' (would have) installed.
 uninstall:
        @if test "X$(LIB)" != X; then                                         \
@@ -224,6 +264,13 @@ uninstall:
           fi;                                                                \
        done
 
+# Uninstall python script in $(bindir)
+       @for f in X $(UI_PY_FILES); do                                        \
+          if test $$f != X; then                                             \
+            $(LT_UNINSTALL) $(bindir)/$$f ;                  \
+          fi;                                                                \
+       done
+
 # Uninstall pyqt script in $(sharedpydir)
        @for f in X $(EXPORT_SHAREDPYSCRIPTS); do                                     \
           if test $$f != X; then                                             \
@@ -327,11 +374,7 @@ distclean: clean
        $(SWIG) $(SWIG_FLAGS) -o $@ $<
 
 $(top_builddir)/share/salome/resources/%.qm: %.po
-       if test -e ${KERNEL_ROOT_DIR}/bin/salome/msg2qm ; then \
-               ${KERNEL_ROOT_DIR}/bin/salome/msg2qm $< $@ ; \
-       else \
-               $(top_builddir)/bin/salome/msg2qm $< $@ ; \
-       fi
+       $(MSG2QM) $< $@ ; \
 
 #------------------------------------------------------------------------------
 # The following section of this makefile contains dependencies between the