Salome HOME
updated copyright message
[modules/kernel.git] / salome_adm / unix / DEPRECATED / make_module.in
1 # Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # generic rule to put in top module Makefile 
24 # (for example with module SALOME, SALOME/Makefile.in and SALOME/src/Makefile.in)
25 # build all lib in all subdir
26 #
27 lib:$(SUBDIRS:%=lib_%)
28
29 $(SUBDIRS:%=lib_%):lib_%:%
30         cd $< ; $(MAKE) lib
31
32 # build all bin in all subdir
33 bin:
34         @@SETX@; for d in $(SUBDIRS); do        \
35            (cd $$d && $(MAKE) $@) || exit 1;    \
36         done
37
38 # launch check in all subdir
39 check: tests
40 tests:
41         @@SETX@; for d in $(SUBDIRS); do        \
42            (cd $$d && $(MAKE) $@) || exit 1;    \
43         done
44
45 # copy all header files in common directory
46 inc:
47         @@SETX@; for d in $(SUBDIRS); do        \
48            (cd $$d && $(MAKE) $@) || exit 1;    \
49         done
50
51 exportinc:
52         @@SETX@; for d in $(SUBDIRS); do        \
53            (cd $$d && $(MAKE) $@) || exit 1;    \
54         done
55
56 # copy all idl files in common directory
57 idl:
58         @@SETX@; for d in $(SUBDIRS); do        \
59            (cd $$d && $(MAKE) $@) || exit 1;    \
60         done
61
62 dep: depend
63
64 depend:
65         @@SETX@; for d in $(SUBDIRS); do        \
66            (cd $$d && $(MAKE) $@) || exit 1;    \
67         done
68
69 # copy all resources files in common directory
70 RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
71 RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
72 RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
73 RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
74 RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
75
76 resources: resources-cp
77         @@SETX@; for d in $(SUBDIRS); do        \
78            (cd $$d && $(MAKE) $@) || exit 1;    \
79         done
80
81 resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
82
83 $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
84         cp -fr $< $@;
85
86 #data:
87 #       @if test "X$(top_builddir)" = "X."; then                                                         \
88 #       ((cd examples && $(MAKE) $@) || exit 1);                         \
89 #       fi;
90 # Commented because we need not to make docs when we make BUILD         
91 # docs: 
92 #       @if test "X$(top_builddir)" = "X."; then \
93 #       ((cd doc && $(MAKE) $@) || exit 1); \
94 #       fi;     
95
96 install: install-resources
97         @@SETX@; for d in $(SUBDIRS); do        \
98            (cd $$d && $(MAKE) $@) || exit 1;    \
99         done
100         @if test "X$(top_builddir)" = "X."; then        \
101            $(LT) --mode=finish $(libdir) ;              \
102         fi
103
104 uninstall: uninstall-resources
105         @@SETX@; for d in $(SUBDIRS); do        \
106            (cd $$d && $(MAKE) $@) || exit 1;    \
107         done
108
109 cleandep:
110         @@SETX@; for d in $(SUBDIRS); do        \
111            (cd $$d && $(MAKE) $@) || exit 1;    \
112         done
113
114 mostlyclean:
115         @@SETX@; for d in $(SUBDIRS); do        \
116            (cd $$d && $(MAKE) $@) || exit 1;    \
117         done
118
119 clean:
120         @@SETX@; for d in $(SUBDIRS); do        \
121            (cd $$d && $(MAKE) $@) || exit 1;    \
122         done
123         -$(RM) .depend *~ *% core *.core *.bak *.new *.old
124
125 distclean: clean
126         @@SETX@; for d in $(SUBDIRS); do        \
127            (cd $$d && $(MAKE) $@) || exit 1;    \
128         done
129         -$(RM) $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
130         -$(RM) Makefile
131
132 install-resources: resources-cp
133 # one resources directory for all salome modules
134         $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
135         @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
136            if test $$f != X; then                                                        \
137              ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1);                      \
138            fi;                                                                           \
139         done
140
141 # Uninstall resources files
142 uninstall-resources:
143         @for f in X $(RESOURCES_FILES); do            \
144            if test $$f != X; then                                             \
145              $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ;                        \
146            fi;                                                                \
147         done
148