- Timestamp:
- 09/25/2007 06:06:33 PM (17 years ago)
- Branches:
- experimental
- Children:
- 5a4f6a7
- Parents:
- 3b6adab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/makefile-functions
r3b6adab rf11a672 57 57 endef 58 58 59 define 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 68 endef 69 59 70 #======================= 60 71 61 72 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 === 119 74 120 75 define touch_timestamp … … 136 91 -newer $(SRCSDIR)/timestamp-marker -not -type d \ 137 92 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1) 138 endef139 140 #==@141 142 define remove_build_dirs143 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \144 rm -rf $(SRCSDIR)/$$ROOT && \145 rm -rf $(SRCSDIR)/$(1)-build146 endef147 148 define remove_build_dirs2149 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \150 rm -rf $(SRC)/$$ROOT && \151 rm -rf $(SRC)/$(1)-build152 endef153 154 #==#155 156 define housekeeping157 @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 fi165 93 endef 166 94
Note:
See TracChangeset
for help on using the changeset viewer.