Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Sep 22, 2010
1 parent 40df733 commit da727fb
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ CURL_OPT=
RECORD_SCRIPT=.mkrecord
TAR=tar czvf

GIT_SOURCES=

# INTERNAL FUNCTIONS {{{
record_file = \
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
Expand All @@ -71,6 +73,35 @@ record_file = \

# PUBLIC FUNCTIONS {{{

GIT_SOURCES=
DEPEND_DIR=/tmp/vim-deps

# Usage:
#
# $(call install_git_sources)
#

install_git_source = \
PWD=$(PWD) ; \
mkdir -p $(DEPEND_DIR) ; \
cd $(DEPEND_DIR) ; \
for git_uri in $(GIT_SOURCES) ; do \
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
echo $$OUTDIR ; \
if [[ -e $$OUTDIR ]] ; then \
cd $$OUTDIR ; \
git pull origin master && \
make install && cd .. ; \
else \
git clone $$git_uri $$OUTDIR && \
cd $$OUTDIR && \
make install && cd .. ; \
fi; \
done ;




# install file by inspecting content
install_file = \
PTYPE=`cat $(1) | perl -nle 'print $$1 if /^"\s*script\s*type:\s*(\S*)$$/i'` ;\
Expand All @@ -97,6 +128,13 @@ fetch_url = \
; fi \
; echo $(2) >> .bundlefiles


install_source = \
for git_uri in $(GIT_SOURCES) ; do \
OUTDIR=$$(echo $$git_uri | perl -pe 's{^.*/}{}') ;\
echo $$OUTDIR ; \
done

# fetch script from github
fetch_github = \
@if [[ -e $(5) ]] ; then \
Expand Down Expand Up @@ -173,14 +211,20 @@ CONFIG_FILE=config.mk
# ======= SECTIONS ======= {{{
-include ext.mk

all: install
all: install-deps install

install-deps:
# check required binaries
[[ -n $$(which git) ]]
[[ -n $$(which bash) ]]
[[ -n $$(which vim) ]]
[[ -n $$(which wget) || -n $$(which curl) ]]
$(call install_git_sources)

check-require:
@if [[ -n `which wget` || -n `which curl` || -n `which fetch` ]]; then echo "wget|curl|fetch: OK" ; else echo "wget|curl|fetch: NOT OK" ; fi
@if [[ -n `which vim` ]] ; then echo "vim: OK" ; else echo "vim: NOT OK" ; fi


config:
@rm -f $(CONFIG_FILE)
@echo "NAME=" >> $(CONFIG_FILE)
Expand Down

0 comments on commit da727fb

Please sign in to comment.