Reordered makefile_functions.

This commit is contained in:
Manuel Canales Esparcia 2006-11-12 12:10:25 +00:00
parent ca6b2614cb
commit 1f81129de6
3 changed files with 42 additions and 27 deletions

View file

@ -69,7 +69,7 @@ ${THIS_SCRIPT}: ${PREV_SCRIPT}
@\$(call echo_message, Building) @\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID & @./progress_bar.sh \$@ \$\$PPID &
@\$(call remove_existing_dirs2,${PKG_FILE}) @\$(call remove_existing_dirs2,${PKG_FILE})
@\$(call unpack3,${PKG_FILE}) @\$(call unpack2,${PKG_FILE})
@\$(call get_pkg_root2) @\$(call get_pkg_root2)
@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT} @( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
@\$(call remove_build_dirs2,${PKG}) @\$(call remove_build_dirs2,${PKG})

View file

@ -162,7 +162,7 @@ EOF
fi fi
( (
cat << EOF cat << EOF
@\$(call unpack3,$FILE) @\$(call unpack2,$FILE)
@\$(call get_pkg_root2) @\$(call get_pkg_root2)
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp

View file

@ -16,6 +16,8 @@ REVERSE = ""
tab_ = " " tab_ = " "
nl_ = "" nl_ = ""
#==== BUILD MESSAGES ===
define echo_PHASE define echo_PHASE
@clear @clear
@echo $(BOLD)-------------------------------------------------------------------------------- @echo $(BOLD)--------------------------------------------------------------------------------
@ -52,6 +54,11 @@ define echo_message
@echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE) @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
endef endef
#=======================
#=== BUILD FUNCTIONS ===
define remove_existing_dirs define remove_existing_dirs
@PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \ @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \ ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
@ -66,25 +73,19 @@ define remove_existing_dirs2
rm -rf $(SRC)/$${ROOT%-*}-build rm -rf $(SRC)/$${ROOT%-*}-build
endef endef
define remove_build_dirs #==#
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
rm -rf $(SRCSDIR)/$$ROOT && \ define unpack
rm -rf $(SRCSDIR)/$(1)-build @cd $(SRCSDIR) && \
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
endef endef
define remove_build_dirs2 define unpack2
@ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \ @cd $(SRC) && \
rm -rf $(SRC)/$$ROOT && \ tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
rm -rf $(SRC)/$(1)-build
endef endef
define housekeeping #==#
@touch $@ && \
sleep .25 && \
echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
echo --------------------------------------------------------------------------------$(WHITE)
endef
define get_pkg_root define get_pkg_root
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \ @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
@ -106,21 +107,35 @@ define get_pkg_root_LUSER
echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
endef endef
define unpack #==#
@cd $(SRCSDIR) && \
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) define remove_build_dirs
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
rm -rf $(SRCSDIR)/$$ROOT && \
rm -rf $(SRCSDIR)/$(1)-build
endef endef
define unpack2 define remove_build_dirs2
@cd $(SRCSDIR) && \ @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
/tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) rm -rf $(SRC)/$$ROOT && \
rm -rf $(SRC)/$(1)-build
endef endef
define unpack3 #==#
@cd $(SRC) && \
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) define housekeeping
@touch $@ && \
sleep .25 && \
echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
echo --------------------------------------------------------------------------------$(WHITE)
endef endef
#=======================
#==== FINAL MESSAGES ===
define echo_report define echo_report
@echo @echo
@echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created @echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created