From fe08d0d17ffebc4b834d898edc8e890463998581 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 5 Apr 2006 13:12:38 +0000 Subject: [PATCH] Porting on Mandriva 64 (use libtool way as much as possible) --- salome_adm/unix/DEPRECATED/make_conclude.in | 106 +++++++++----------- 1 file changed, 49 insertions(+), 57 deletions(-) diff --git a/salome_adm/unix/DEPRECATED/make_conclude.in b/salome_adm/unix/DEPRECATED/make_conclude.in index a66834628..d3cd222ae 100644 --- a/salome_adm/unix/DEPRECATED/make_conclude.in +++ b/salome_adm/unix/DEPRECATED/make_conclude.in @@ -35,44 +35,21 @@ LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC))) # all libtool obj file in library 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) -# 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))) else LIB_SWIG = endif -lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY) +lib: $(LIB) $(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 -sf $(CURDIR)/$< $@ || true - ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \ - $(patsubst %.la, %.so, $@) || true - ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \ - $(patsubst %.la, %.so, $@).0 || true - - if test "X$(LIB_SWIG)" != "X"; then \ - 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 -sf $(CURDIR)/$< $@ || true - -$(LIB_BUILD_SO): $(top_builddir)/lib/salome/%.so: %.so - -$(RM) $@ - ln -sf $(CURDIR)/$< $@ || true +LIB_BUILDDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/lib/salome $(LIB): $(LIB_OBJ) - @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + $(LT) --mode=uninstall $(RM) $(LIB_BUILDDIR)/$@ + $(LT) --mode=link $(CXX) -shared -rpath $(LIB_BUILDDIR) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + $(LT_INSTALL_LIB) $@ $(LIB_BUILDDIR)/$@ # transform idl reference in appropriate obj file BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) @@ -91,16 +68,16 @@ BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC))) # all obj file in bin target BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ) -bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts +bin: $(BIN) pyscripts sharedpyscripts BIN_LIB=$(LIB:lib%.la=-l%) -$(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: % - -$(RM) $@ - ln -sf $(CURDIR)/$< $@ +BIN_BUILDDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/bin/salome -$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) +$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) $(LIB) + $(LT) --mode=uninstall $(RM) $(BIN_BUILDDIR)/$@ + $(LT) --mode=link $(CXX) -rpath $(BIN_BUILDDIR) -o $@ $^ $(CXXFLAGS) $(CPPFLAGS) $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) + $(LT_INSTALL_PROG) $@ $(BIN_BUILDDIR)/$@ # copy python scripts in $(top_builddir)/bin/salome # @@ -176,30 +153,39 @@ $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir): # 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-res - @for f in X $(LIB); do \ - if test $$f != X; then \ - ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \ - fi; \ + @for f in X $(LIB); do \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath '$(libdir)' -o '$$f' $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath "$(libdir)" -o "$$f" $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_LIB) '$$f' '$(libdir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_LIB) "$$f" "$(libdir)/$$f" || exit 1); \ + fi; \ done - @if test "X$(LIB_SWIG)" != "X"; then \ + @if ! test -z $(LIB_SWIG) ; then \ (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 \ - ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \ - fi; \ + @for f in X $(BIN); do \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath '$(bindir)' -o '$$f' $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath "$(bindir)" -o "$$f" $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$$f" || exit 1); \ + fi; \ done -# Install tests programmes in bindir - @for f in X $(TEST_PROGS); do \ - if test $$f != X; then \ - ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \ - fi; \ + # Install tests programmes in bindir + @for f in X $(TEST_PROGS); do \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath '$(bindir)' -o '$$f' $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath "$(bindir)" -o "$$f" $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$$f" || exit 1); \ + fi; \ done -# Install exported includes in includedir - @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \ - if test $$f != X; then \ - (cp -p -f $$f $(includedir) || exit 1); \ - fi; \ + # Install exported includes in includedir + @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \ + if test $$f != X; then \ + (cp -p -f $$f $(includedir) || exit 1); \ + fi; \ done # Install python script in $(bindir) @@ -349,25 +335,31 @@ distclean: clean $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< .cc.lo: - $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + $(LT) --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< .cxx.o: $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< .cxx.lo: - $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< + $(LT) --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< .c.lo: - $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $< + $(LT) --mode=compile --tag=CC $(CFLAGS) $(CPPFLAGS) -c $< .f.o: $(FC) $(FFLAGS) -c $< -o $@ .f.lo: - $(LT) --mode=compile $(FC) $(FFLAGS) -c $< + $(LT) --mode=compile --tag=F77 $(FC) $(FFLAGS) -c $< + +.f90.o: + $(FC) $(FFLAGS) -c $< -o $@ + +.f90.lo: + $(LT) --mode=compile --tag=F90 $(FC) $(FFLAGS) -c $< .ui.h: $(UIC) -o $@ $< -- 2.39.2