Changeset 588 for CMT/HEAD/src


Ignore:
Timestamp:
Nov 27, 2011, 4:36:15 PM (13 years ago)
Author:
rybkin
Message:

See C.L. 465

Location:
CMT/HEAD/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/src/Makefile.core

    r556 r588  
    135135# add to the list of valid suffixes
    136136# so that nonterminal match-anything rules will not be considered
    137 .SUFFIXES: .make .stamp .cxx
     137.SUFFIXES: .make .in .stamp .cxx
  • CMT/HEAD/src/Makefile.header

    r547 r588  
    1919
    2020cmt_local_tagfile = $(bin)$(tag).make
     21cmt_broadcast_tagfile = $(bin)$(tag)_broadcast.make
    2122
    2223cmt_constituents_makefile = $(bin)constituents.make
    23 
    24 cmt_local_setup = $(bin)setup$$$$.make
    25 #cmt_local_setup = $(bin)$(package)setup$$$$.make
    26 #cmt_final_setup = $(bin)${PACKAGE}setup.make
     24cmt_broadcast_makefile = $(bin)broadcast.make
     25
    2726cmt_final_setup = $(bin)setup.make
    28 #cmt_final_setup = $(bin)$(package)setup.make
    29 
    30 #
    31 #  Generic entry points for all targets
    32 #
    33 #ifndef QUICK
    34 #all :: check_config ;
    35 #else
    36 #all :: no_check_config ;
    37 #endif
    38 #all :: $(cmt_constituents_makefile)
    39 #       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
    40 default :: all ;
     27
     28cmt_check_configurationstamp = $(bin)cmt_check_configuration.stamp
     29
     30ifdef CMTBCAST
     31QUICK = 1
     32endif
     33
     34ifdef QUICK
     35ifndef CMTBCAST
     36
     37ifneq ($(MAKECMDGOALS),binclean)
     38ifneq ($(MAKECMDGOALS),help)
     39cmt_included = 1
     40-include $(cmt_local_tagfile)
     41endif
     42endif
     43
     44else
     45
     46ifneq ($(MAKECMDGOALS),help)
     47cmt_included = 1
     48-include $(cmt_broadcast_tagfile)
     49endif
     50
     51endif
     52endif
     53
     54all ::
     55ifndef CMTBCAST
     56ifndef cmt_included
     57        @$(MAKE) $(cmt_constituents_makefile)
     58endif
     59        $(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
     60else
     61ifndef cmt_included
     62        @$(MAKE) $(cmt_broadcast_makefile)
     63endif
     64        @$(MAKE) --no-print-directory -f $(cmt_broadcast_makefile) CMTBCAST= $@
     65endif
     66
     67.DEFAULT :
     68ifndef CMTBCAST
     69ifndef cmt_included
     70        @$(MAKE) $(cmt_constituents_makefile)
     71endif
     72        @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
     73else
     74ifndef cmt_included
     75        @$(MAKE) $(cmt_broadcast_makefile)
     76endif
     77        @$(MAKE) --no-print-directory -f $(cmt_broadcast_makefile) CMTBCAST= $@
     78endif
    4179
    4280check_config ::
    43         @$(cmtexe) check configuration; retval=$$?; \
    44         if test $${retval} -ne 0; then \
    45           test -z "$(cmtmsg)" || \
    46           echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
    47         fi; exit $${retval}
    48 
    49 #       @$(cmtexe) check configuration; retval=$$?; \
    50 #       if test $${retval} = 0; then \
    51 #         $(MAKE) --no-print-directory target="all" common_target; \
    52 #       else \
    53 #         test -z "$(cmtmsg)" || \
    54 #         echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
    55 #       fi
    56 
    57 #no_check_config ::
    58 #       @$(MAKE) --no-print-directory target="all" common_target
    59 
    60 binclean ::
    61         if test ! "$(bin)" = "./"; then \
    62           if test -d $(bin) ; then \
    63             test -z "$(cmtmsg)" || \
    64             echo "$(CMTMSGPREFIX)" "(Makefile.header) Removing binary directory $(bin)"; \
    65             \rm -rf $(bin) ; \
    66           fi ; \
    67         fi
    68 
    69 #clean uninstall :: check_config
    70 #       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
    71 #       @$(cmtexe) check configuration
    72 #       @$(MAKE) --no-print-directory target="$@" common_target
    73 
    74 .DEFAULT ::
    75         @$(MAKE) $(cmt_constituents_makefile)
    76         @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
    77 
    78 #       @$(cmtexe) check configuration
    79 #       @$(MAKE) --no-print-directory target="$@" common_target
    80 #       @$(MAKE) --no-print-directory target="config $@" common_target
    81 
    82 #
    83 #  Capture all possible targets
    84 #
    85 #common_target : $(cmt_constituents_makefile)
    86 #       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $(target)
    87 
    88 #$(cmt_constituents_makefile) : $(cmt_local_tagfile)
     81        +@$(cmtexe) check configuration; retval=$$?; \
     82          if test $${retval} -ne 0; then \
     83            test -z "$(cmtmsg)" || \
     84            echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
     85          fi; exit $${retval}
     86
     87$(cmt_check_configurationstamp) : $(use_requirements)
     88        +@$(cmtexe) check configuration; retval=$$?; \
     89          if test $${retval} -ne 0; then \
     90            test -z "$(cmtmsg)" || \
     91            echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
     92          fi; exit $${retval}
     93        +$(silent) if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi && \touch $@
     94#       echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; exit 17
    8995
    9096ifndef QUICK
    91 $(cmt_constituents_makefile) : check_config
    92 else
    93 $(cmt_constituents_makefile) :
    94 endif
    95         $(echo) "(Makefile.header) Rebuilding $@"; \
     97$(cmt_constituents_makefile) ::
     98#$(cmt_constituents_makefile) : check_config
     99else
     100$(cmt_local_tagfile) $(cmt_constituents_makefile) : $(use_requirements)
     101#$(cmt_local_tagfile) $(cmt_constituents_makefile) : $(cmt_check_configurationstamp)
     102endif
     103        +$(echo) "(Makefile.header) Rebuilding $@"; \
    96104          if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi; \
    97           $(cmtexe) -tag=$(tags) build constituents_config -out=$@; \
     105          $(cmtexe) -tag=$(tags) build constituents_config -out=$(cmt_constituents_makefile); \
    98106          retval=$$?; \
    99107          if test $${retval} -ne 0; then \
     
    105113
    106114ifndef QUICK
    107 $(cmt_local_tagfile) ::
    108 else
    109 $(cmt_local_tagfile) :
    110 endif
    111         $(echo) "(Makefile.header) Rebuilding $@"; \
    112           if test -f $@; then rm -f $@; fi; \
    113           if test ! -d $(@D); then $(mkdir) -p $(@D); fi; \
    114           $(cmtexe) -tag=$(tags) build tag_makefile >$@
    115         $(echo) "(Makefile.header) Rebuilding $(cmt_final_setup)"; \
    116           test ! -f $(cmt_local_setup) || \rm -f $(cmt_local_setup); \
    117           trap '\rm -f $(cmt_local_setup)' 0 1 2 15; \
    118           $(cmtexe) -tag=$(tags) show setup >$(cmt_local_setup) && \
    119           if [ -f $(cmt_final_setup) ] && \
    120             \cmp -s $(cmt_final_setup) $(cmt_local_setup); then \
    121             \rm $(cmt_local_setup); else \
    122             \mv -f $(cmt_local_setup) $(cmt_final_setup); fi
     115$(cmt_broadcast_makefile) ::
     116#$(cmt_broadcast_makefile) : check_config
     117else
     118$(cmt_broadcast_tagfile) $(cmt_broadcast_makefile) : $(use_requirements)
     119#$(cmt_broadcast_makefile) : $(cmt_check_configurationstamp)
     120endif
     121        +$(echo) "(Makefile.header) Rebuilding $@"; \
     122          if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi; \
     123          $(cmtexe) -tag=$(tags) build broadcast_config -out=$(cmt_broadcast_makefile); \
     124          retval=$$?; \
     125          if test $${retval} -ne 0; then \
     126            test -z "$(cmtmsg)" || \
     127            echo "$(CMTMSGPREFIX)" "(Makefile.header) Cannot generate $@" >&2; \
     128            \rm -f $@; \
     129          fi; \
     130          exit $${retval}
    123131
    124132#
     
    134142everywhere :: $(everywhere)
    135143
     144ifndef CMTBCAST
     145binclean ::
     146        if _bin=`cd $(bin) 2>/dev/null&&pwd -P`&&_cur=`pwd -P`&&[ -n "$${_bin}" ]&&[ "$${_cur#$${_bin}}" = "$${_cur}" ] ; then \
     147            test -z "$(cmtmsg)" || \
     148            echo "$(CMTMSGPREFIX)" "(Makefile.header) Removing binary directory $(bin)"; \
     149            \rm -rf $(bin) ; \
     150        fi
     151endif
     152
    136153#
    137154#   Display all targets
    138155#
    139156help ::
     157ifndef CMTBCAST
    140158        @echo '--------------------------------------------------------------------------'
    141159        @echo 'You may select one of the following make targets :'
     
    160178        @echo '              run all applications defined with the -check option'
    161179        @echo ' '
    162 
    163 
    164 # explicit rule not to remake
     180        @echo 'To switch to BCAST mode, set CMTBCAST to non-empty string.'
     181else
     182        @echo 'Targets for BCAST mode:'
     183        @echo
     184        @echo 'help        : this help'
     185ifndef BCAST_ONLY
     186ifndef BCAST_GLOBAL
     187        @echo 'all         : (re)build all used packages in current project (this is default target)'
     188else
     189        @echo 'all         : (re)build all used packages in all projects (this is default target)'
     190endif
     191else
     192        @echo 'all         : (re)build current package (this is default target)'
     193endif
     194        @echo 'clean       : remove everything that can be rebuilt'
     195        @echo 'binclean    : fast erase of binary directories (and installation area)'
     196        @echo 'uninstall   : remove everything installed in the installation area'
     197        @echo
     198ifndef BCAST_GLOBAL
     199        @uses=`$(cmtexe) -private show macros '_project$$|package$$' -tag=$(tags)| \
     200          awk -F = '{if ($$1 ~ /_project$$/) {uses[substr($$1,1,length($$1)-8)]=$$2}else if ($$1 == "package") {cur = $$2;gsub("'\''","",cur)}}END{for (u in uses){if (uses[u]==uses[cur]) print u}}'`; \
     201          for u in $${uses}; do \
     202            echo "$${u} : (re)build package $${u} ($(_groups))"; \
     203            echo "$${u}clean : remove everything that can be rebuilt in package $${u}"; \
     204            echo "$${u}binclean : fast erase of binary directory in package $${u}"; \
     205            echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \
     206          done
     207else
     208        @uses=`$(cmtexe) -private show macros '_root$$' -tag=$(tags)| \
     209          awk -F = '{u=substr($$1,1,length($$1)-5);if (u != "CMT" && u != "CMTHOME" && u != "CMTUSERCONTEXT") print u}'`; \
     210          for u in $${uses}; do \
     211            echo "$${u} : (re)build package $${u} ($(_groups))"; \
     212            echo "$${u}clean : remove everything that can be rebuilt in package $${u}"; \
     213            echo "$${u}binclean : fast erase of binary directory in package $${u}"; \
     214            echo "$${u}uninstall : remove everything installed in the installation area from package $${u}"; \
     215          done
     216endif
     217        @echo
     218ifndef BCAST_ONLY
     219        @echo '   ... with dependencies packages (may be ignored by setting BCAST_ONLY).'
     220else
     221        @echo '   ... without dependencies packages (may be included by unsetting BCAST_ONLY).'
     222endif
     223        @echo
     224ifndef BCAST_GLOBAL
     225        @echo 'To (re)build packages in all projects, set BCAST_GLOBAL.'
     226else
     227        @echo 'To (re)build packages in current project, unset BCAST_GLOBAL.'
     228endif
     229ifndef NO_ALL_GROUPS
     230        @echo 'To (re)build default group only, set NO_ALL_GROUPS.'
     231ifndef CMTACTIONS
     232        @echo 'To also (re)build cmt_actions group, set CMTACTIONS.'
     233endif
     234else
     235        @echo 'To (re)build all groups, unset NO_ALL_GROUPS.'
     236endif
     237        @echo
     238        @echo 'To switch to PACKAGE mode, unset CMTBCAST.'
     239endif
     240
     241ifndef NO_ALL_GROUPS
     242ifndef CMTACTIONS
     243_groups = all groups except cmt_actions
     244else
     245_groups = all groups
     246endif
     247else
     248_groups = default group
     249endif
     250
     251# explicit rule to avoid implicit rule search
     252# and not to remake
    165253${CMTROOT}/src/Makefile.header : ;
     254${CMTROOT}/src/Makefile.core : ;
     255ifdef use_requirements
     256$(use_requirements) : ;
     257endif
    166258
    167259# for multiple command line goals,
  • CMT/HEAD/src/setup.csh

    r584 r588  
    5454
    5555alias jcmt '(java cmt_parser)'
     56
     57# Set MAKEFLAGS, if unset (similar to NPROC with Plan 9 mk utility)
     58if ( $?MAKEFLAGS == 0 ) then
     59  setenv MAKEFLAGS -j`getconf _NPROCESSORS_ONLN` || unsetenv MAKEFLAGS
     60  if ( $?MAKEFLAGS == 1 ) then
     61    setenv MAKEFLAGS "${MAKEFLAGS} QUICK=1"
     62  else
     63    setenv MAKEFLAGS "QUICK=1"
     64  endif
     65endif
  • CMT/HEAD/src/setup.sh

    r585 r588  
    1111fi
    1212
    13 if [ `expr $- : '.*i'` -ne 0 ]; then
     13if [ -n "$-" ] && [ "${-#*i}" != "$-" ]; then
    1414if [ -n "${ZSH_NAME-}" ]; then
    1515  . ${CMTROOT}/src/setup.zsh
     
    4747
    4848alias jcmt='(java cmt_parser)'; export jcmt
     49
     50# Set MAKEFLAGS, if unset (similar to NPROC with Plan 9 mk utility)
     51if [ -z ${MAKEFLAGS+CMT} ]; then
     52  MAKEFLAGS=-j`getconf _NPROCESSORS_ONLN 2>/dev/null` && export MAKEFLAGS || unset MAKEFLAGS
     53  if [ -n "${MAKEFLAGS:-}" ]; then
     54    MAKEFLAGS="${MAKEFLAGS} QUICK=1"
     55  else
     56    MAKEFLAGS="QUICK=1"
     57  fi
     58  export MAKEFLAGS
     59fi
Note: See TracChangeset for help on using the changeset viewer.