Changeset f11a672 for common


Ignore:
Timestamp:
09/25/2007 06:06:33 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
5a4f6a7
Parents:
3b6adab
Message:

Revising makefile-functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/makefile-functions

    r3b6adab rf11a672  
    5757endef
    5858
     59define housekeeping
     60  @touch  $@ && \
     61  sleep .25 && \
     62  echo  -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
     63  echo --------------------------------------------------------------------------------$(WHITE) && \
     64  if [ "$(BREAKPOINT)" = "$@" ] ; then \
     65     echo $(tab_)$(RED)The build has been stopped at $(BLUE)$@ $(RED)as requested$(WHITE) ; \
     66     false ; \
     67  fi
     68endef
     69
    5970#=======================
    6071
    6172
    62 #=== BUILD FUNCTIONS ===
    63 
    64 define remove_existing_dirs
    65   @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
    66   ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
    67   [ -n "$$ROOT" ] && \
    68   if [ -d $(SRCDIR)/$$ROOT ]; then \
    69     rm -rf $(SRCSDIR)/$$ROOT && \
    70     rm -rf $(SRCSDIR)/$${ROOT%-*}-build; \
    71   fi;
    72 endef
    73 
    74 define remove_existing_dirs2
    75   @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
    76   ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
    77   [ -n "$$ROOT" ] && \
    78   if [ -d $(SRC)/$$ROOT ]; then \
    79     rm -rf $(SRC)/$$ROOT && \
    80     rm -rf $(SRC)/$${ROOT%-*}-build; \
    81   fi;
    82 endef
    83 
    84 #==#
    85 
    86 define unpack
    87   @cd $(SRCSDIR) && \
    88   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
    89 endef
    90 
    91 define unpack2
    92   @cd $(SRC) && \
    93   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
    94 endef
    95 
    96 #==#
    97 
    98 define get_pkg_root
    99   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    100   if [ "$(1)" != "nouser" ]; then \
    101     echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
    102     chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
    103   else \
    104     echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
    105   fi;
    106 endef
    107 
    108 define get_pkg_root2
    109   @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    110   echo "export PKGDIR=$(SRC)/$$ROOT" > envars
    111 endef
    112 
    113 define get_pkg_root_LUSER
    114   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    115   echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
    116 endef
    117 
    118 #==#
     73#=== INSTALL_LOG FUNCTIONS ===
    11974
    12075define touch_timestamp
     
    13691  -newer $(SRCSDIR)/timestamp-marker -not -type d \
    13792  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1)
    138 endef
    139 
    140 #==@
    141 
    142 define remove_build_dirs
    143   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    144   rm -rf $(SRCSDIR)/$$ROOT && \
    145   rm -rf $(SRCSDIR)/$(1)-build
    146 endef
    147 
    148 define remove_build_dirs2
    149   @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    150   rm -rf $(SRC)/$$ROOT && \
    151   rm -rf $(SRC)/$(1)-build
    152 endef
    153 
    154 #==#
    155 
    156 define housekeeping
    157   @touch  $@ && \
    158   sleep .25 && \
    159   echo  -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
    160   echo --------------------------------------------------------------------------------$(WHITE) && \
    161   if [ "$(BREAKPOINT)" = "$@" ] ; then \
    162      echo $(tab_)$(RED)The build has been stopped at $(BLUE)$@ $(RED)as requested$(WHITE) ; \
    163      false ; \
    164   fi
    16593endef
    16694
Note: See TracChangeset for help on using the changeset viewer.