source: CMT/HEAD/mgr/fragments/library @ 628

Last change on this file since 628 was 628, checked in by rybkin, 11 years ago

See C.L. 499

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1#-- start of libary ----------------------
2
3${CONSTITUENT}LIB :: $(${CONSTITUENT}lib) $(${CONSTITUENT}shstamp)
4        $(echo) "${CONSTITUENT} : library ok"
5
6$(${CONSTITUENT}lib) :: ${OBJS}
7        $(lib_echo) "static library $@"
8        $(lib_silent) [ ! -f $@ ] || \rm -f $@
9        $(lib_silent) $(ar) $(${CONSTITUENT}lib) ${OBJS}
10        $(lib_silent) $(ranlib) $(${CONSTITUENT}lib)
11        $(lib_silent) cat /dev/null >$(${CONSTITUENT}stamp)
12
13#------------------------------------------------------------------
14#  Future improvement? to empty the object files after
15#  storing in the library
16#
17##        for f in $?; do \
18##          rm $${f}; touch $${f}; \
19##        done
20#------------------------------------------------------------------
21
22#
23# We add one level of dependency upon the true shared library
24# (rather than simply upon the stamp file)
25# this is for cases where the shared library has not been built
26# while the stamp was created (error??)
27#
28
29$(${CONSTITUENT}libname).$(shlibsuffix) :: $(${CONSTITUENT}lib) requirements $(use_requirements) $(${CONSTITUENT}stamps)
30        $(lib_echo) "shared library $@"
31        $(lib_silent) if test "$(makecmd)"; then QUIET=; else QUIET=1; fi; QUIET=$${QUIET} bin="$(bin)" ld="$(shlibbuilder)" ldflags="$(shlibflags)" suffix=$(shlibsuffix) libprefix=$(library_prefix) libsuffix=$(library_suffix) $(make_shlib) "$(tags)" ${CONSTITUENT} $(${CONSTITUENT}_shlibflags)
32        $(lib_silent) cat /dev/null >$(${CONSTITUENT}shstamp)
33
34$(${CONSTITUENT}shstamp) :: $(${CONSTITUENT}libname).$(shlibsuffix)
35        $(lib_silent) if test -f $(${CONSTITUENT}libname).$(shlibsuffix) ; then cat /dev/null >$(${CONSTITUENT}shstamp) ; fi
36
37${CONSTITUENT}clean ::
38        $(cleanup_echo) objects ${CONSTITUENT}
39        $(cleanup_silent) /bin/rm -f ${OBJS}
40        $(cleanup_silent) /bin/rm -f $(patsubst %.o,%.d,${OBJS}) $(patsubst %.o,%.dep,${OBJS}) $(patsubst %.o,%.d.stamp,${OBJS})
41        $(cleanup_silent) cd $(bin); /bin/rm -rf ${CONSTITUENT}_deps ${CONSTITUENT}_dependencies.make
42
43#-----------------------------------------------------------------
44#
45#  New section for automatic installation
46#
47#-----------------------------------------------------------------
48
49install_dir = ${CMTINSTALLAREA}/$(tag)/lib
50${CONSTITUENT}installname = $(library_prefix)${CONSTITUENT}$(library_suffix).$(shlibsuffix)
51
52${CONSTITUENT} :: ${CONSTITUENT}install ;
53
54install :: ${CONSTITUENT}install ;
55
56${CONSTITUENT}install :: $(install_dir)/$(${CONSTITUENT}installname)
57ifdef CMTINSTALLAREA
58        $(echo) "installation done"
59endif
60
61$(install_dir)/$(${CONSTITUENT}installname) :: $(bin)$(${CONSTITUENT}installname)
62ifdef CMTINSTALLAREA
63        $(install_silent) $(cmt_install_action) \
64            -source "`(cd $(bin); pwd)`" \
65            -name "$(${CONSTITUENT}installname)" \
66            -out "$(install_dir)" \
67            -cmd "$(cmt_installarea_command)" \
68            -cmtpath "$($(package)_cmtpath)"
69endif
70
71##${CONSTITUENT}clean :: ${CONSTITUENT}uninstall
72
73uninstall :: ${CONSTITUENT}uninstall ;
74
75${CONSTITUENT}uninstall ::
76ifdef CMTINSTALLAREA
77        $(cleanup_silent) $(cmt_uninstall_action) \
78            -source "`(cd $(bin); pwd)`" \
79            -name "$(${CONSTITUENT}installname)" \
80            -out "$(install_dir)" \
81            -cmtpath "$($(package)_cmtpath)"
82endif
83
84#-- end of libary -----------------------
Note: See TracBrowser for help on using the repository browser.