update mk
This commit is contained in:
parent
20fb7bf166
commit
33d35ac937
@ -1,5 +1,29 @@
|
||||
EMACS_OSX := $(HOME)/Work/oss/build/osx/clang/64/dbg/emacs-new/nextstep/Emacs.app/Contents/MacOS/Emacs
|
||||
EMACS := $(or $(wildcard $(EMACS_OSX)),emacs)
|
||||
|
||||
ifndef HAS_UTIL_MK
|
||||
include $(HOME)/Documents/mk/util.mk
|
||||
endif
|
||||
|
||||
EMACS_OSX := $(wildcard $(HOME)/Work/oss/build/osx/clang/64/dbg/emacs-new/nextstep/Emacs.app/Contents/MacOS/Emacs)
|
||||
EMACS_W32 :=\
|
||||
$(subst ?,$(sp),$(firstword\
|
||||
$(subst $(sp),?,$(wildcard $(call fixpath-make,$(ProgramW6432)/emacs/bin/emacs.exe)))\
|
||||
$(subst $(sp),?,$(wildcard $(call fixpath-make,$(ProgramFiles$(oparen)x86$(cparen))/emacs/bin/emacs.exe)))\
|
||||
$(subst $(sp),?,$(wildcard $(call fixpath-make,$(ProgramFiles)/emacs/bin/emacs.exe)))))
|
||||
|
||||
EMACS := $(or $(EMACS_OSX),$(EMACS_W32),emacs)
|
||||
|
||||
ifeq (cygwin,$(HOSTENV))
|
||||
ifneq (,$(findstring emacs/bin/emacs.exe,$(EMACS)))
|
||||
EMACS_CYGWIN := emacs
|
||||
fixpath-emacs = $(subst $(sp),?,$(shell cygpath -ma $(call fixpath-cyg,$(1))))
|
||||
endif
|
||||
else
|
||||
fixpath-emacs = $(subst /,\\\\,$(shell cd $(1)&&pwd -W))
|
||||
endif
|
||||
|
||||
fixpath-emacs ?= $(1)
|
||||
|
||||
emacspath = $(foreach f,$(1),$(call fixpath-emacs,$(f)))
|
||||
|
||||
#SHELL := sh.exe -x
|
||||
#$(error E:$(EMACS))
|
||||
@ -15,7 +39,7 @@ TEXI2DVI := texi2dvi
|
||||
PS2PDF := ps2pdf
|
||||
DVIPDFM := dvipdfm
|
||||
|
||||
CEDET_HOME := $(subst /cygdrive/d,,$(LISP_DIR)/cedet)
|
||||
CEDET_HOME := $(LISP_DIR)/cedet
|
||||
|
||||
#$(error '$(call emacspath,.)')
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
# general emacs lisp pattern rules
|
||||
# #########################################################################
|
||||
%/elisp-all:
|
||||
$(MAKE) -C $* $(@F)
|
||||
"$(MAKE)" -C $* $(@F)
|
||||
|
||||
%.elc : %.el
|
||||
$(EMACS) -batch -q -no-site-file\
|
||||
"$(EMACS)" -batch -q -no-site-file\
|
||||
$(addprefix -L ,$(LOAD_PATH))\
|
||||
$(EMACSFLAGS)\
|
||||
-f batch-byte-compile $(call emacspath,$?)
|
||||
|
||||
59
util.mk
59
util.mk
@ -3,26 +3,6 @@ HAS_UTIL_MK := T
|
||||
|
||||
MK_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
ifneq (,$(or $(ComSpec),$(COMSPEC),$(comspec)))
|
||||
ifneq (Cygwin,$(shell uname -a))
|
||||
NULL := /dev/null
|
||||
fixpath = $(1)
|
||||
emacspath = $(foreach f,$(1),$(shell cygpath -ma $(f)))
|
||||
else ifneq (,$(MSYSTEM))
|
||||
fixpath = $(foreach f,$(1),$(if $(subst $(f),,$(subst :,,$(f))),\
|
||||
$(subst //,/,/$(firstword $(subst :, ,$(f)))$(subst \,/,$(lastword $(subst :, ,$(f))))),$(f)))
|
||||
ifneq (,$(filter MSYS% MINGW%,$(MSYSTEM)))
|
||||
#$(info test: $(filter MSYS% MINGW%,$(MSYSTEM)))
|
||||
emacspath = $(foreach f,$(1),$(subst /,\\\\,$(shell cd $(f)&&pwd -W)))
|
||||
else
|
||||
RM := del
|
||||
DIRSEP := $(if T,\)
|
||||
SHQ := ^
|
||||
RD := rmdir /q /s
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# define the $(\n) macro which has the value '\n'
|
||||
# Note: This really requires two empty lines!
|
||||
ifndef \n
|
||||
@ -93,10 +73,25 @@ sp := $(dummy) $(dummy)
|
||||
PARENO := (
|
||||
PARENC := )
|
||||
|
||||
ifneq (,$(or $(ComSpec),$(COMSPEC),$(comspec)))
|
||||
ifneq (,$(filter Cygwin,$(shell uname -a)))
|
||||
HOSTENV := cygwin
|
||||
NULL := /dev/null
|
||||
fixpath-shell = $(subst $(sp),\$(sp),$(subst $(oparen),\$(oparen),$(subst $(cparen),\$(cparen),$(subst \,/,$(1)))))
|
||||
fixpath-cyg = $(call fixpath-shell,$(1))
|
||||
fixpath-make = $(strip\
|
||||
$(subst $(sp),?,$(shell cygpath $(call fixpath-cyg,$(1)))))
|
||||
else
|
||||
HOSTENV := w32
|
||||
NULL := nul
|
||||
fixpath-make = $(subst \,/,$(subst $(sp),?,$(1)))
|
||||
endif
|
||||
endif
|
||||
|
||||
DIRSEP ?= /
|
||||
SHQ ?= $(if T,\)
|
||||
emacspath ?= $(1)
|
||||
fixpath ?= $(1)
|
||||
fixpath-make ?= $(1)
|
||||
fixpath-shell ?= $(1)
|
||||
|
||||
TEST := test
|
||||
RD ?= rm -rf
|
||||
@ -104,24 +99,24 @@ RD ?= rm -rf
|
||||
NULL ?= $(or $(wildcard /dev/null),nul)
|
||||
|
||||
ifeq (T,$(V))
|
||||
mk-debug = $(info $1)
|
||||
mk-debug-lno = $(warning $(\n)$1)
|
||||
mk-debug-vars = $(foreach _mkv,$1,$(info $(_mkv) := '$($(_mkv))'))
|
||||
mk-debug = $(info $(1))
|
||||
mk-debug-lno = $(warning $(\n)$(1))
|
||||
mk-debug-vars = $(foreach _mkv,$(1),$(info $(_mkv) := '$($(_mkv))'))
|
||||
endif
|
||||
|
||||
define include-once-helper
|
||||
ifndef $(subst ?,_,$(subst /,_,$2))-included
|
||||
ifneq (,$(wildcard $2))
|
||||
$(subst ?,_,$(subst /,_,$2))-included := T
|
||||
$$(call mk-debug-lno,+ including '$1')
|
||||
include $2
|
||||
ifndef $(subst ?,_,$(subst /,_,$(2)))-included
|
||||
ifneq (,$(wildcard $(2)))
|
||||
$(subst ?,_,$(subst /,_,$(2)))-included := T
|
||||
$$(call mk-debug-lno,+ including '$(1)')
|
||||
include $(2)
|
||||
else
|
||||
$$(call mk-debug-lno,[WARN] could not find '$1')
|
||||
$$(call mk-debug-lno,[WARN] could not find '$(1)')
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
include-once = $(eval $(call include-once-helper,$1,$(subst $(sp),?,$1)))
|
||||
include-once = $(eval $(call include-once-helper,$1,$(subst $(sp),?,$(1))))
|
||||
|
||||
# END: HAS_UTIL_MK
|
||||
endif
|
||||
|
||||
42
vcs.mk
42
vcs.mk
@ -37,19 +37,23 @@ CVS := $(or $(patsubst %,"%",$(subst /,$(DIRSEP),$(wildcard c:/Program?Files/CVS
|
||||
CVSFLAGS := $(shell cvs --lf --version 2>$(NULL) >$(NULL)&&echo --lf)
|
||||
CVSUP_FLAGS := -CPd
|
||||
|
||||
ifneq (,$(filter http% HTTP%,$(PROXY)))
|
||||
URL_FILTERS := http: https:
|
||||
ifneq (,$(filter http% HTTP%,$(PROXY) $(http_proxy) $(HTTP_PROXY)))
|
||||
URL_FILTERS := http:% https:%
|
||||
endif
|
||||
|
||||
info-vcs-template =\
|
||||
$(info $(call $1,$2,$(URL-$2)))
|
||||
|
||||
eval-vcs-template =\
|
||||
$(if $(filter $(or $(addsuffix %,$(subst +, ,$(URL_FILTERS))),%,),$(URL-$2)),$(eval $(call $1,$2,$(URL-$2))))
|
||||
$(eval $(call $1,$2,$(URL-$2)))
|
||||
|
||||
define HG_TMPL
|
||||
DIR-$(notdir $1) := $1
|
||||
ifeq (,$(filter-out $(URL_FILTERS),$2))
|
||||
.PHONY: pull-$1
|
||||
updaterepos: pull-$1
|
||||
subrepos: $1/.hg
|
||||
clean-subrepos: $1/.hg
|
||||
DIR-$(notdir $1) := $1
|
||||
$1/.hg:
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@echo +++ Creating[hg]: $(SHQ)'$1$(SHQ)' from $(SHQ)'$2$(SHQ)'
|
||||
@ -66,19 +70,28 @@ pull-$1:
|
||||
$(HG) -R $(subst /,$(DIRSEP),$(subst $(DOT_DIR)/,,$1)) update $(HGPULL_FLAGS)
|
||||
$$(post_up_cmd-$1)
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define SVN_TMPL
|
||||
DIR-$(notdir $1) := $1
|
||||
ifeq (,$(filter-out $(URL_FILTERS),$2))
|
||||
.PHONY: up-$1
|
||||
update: up-$1
|
||||
updaterepos: up-$1
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
subrepos: $1/.svn
|
||||
clean-subrepos: $1/.svn
|
||||
DIR-$(notdir $1) := $1
|
||||
else
|
||||
.PHONY: $1/.svn
|
||||
initrepos: $1/.svn
|
||||
endif
|
||||
$1/.svn:
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@echo +++ Creating[svn]: $(SHQ)'$1$(SHQ)' from $(SHQ)'$2$(SHQ)'
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
$(TEST) ! -d $1 || $(RD) $(subst /,$(DIRSEP),$1)
|
||||
endif
|
||||
$(SVN) checkout $2 $1
|
||||
|
||||
up-$1:
|
||||
@ -89,12 +102,14 @@ up-$1:
|
||||
@cd $(subst /,$(DIRSEP),$1) >$(NULL) 2>&1 && $(SVN) $(SVNFLAGS) update $(SVNUP_FLAGS)
|
||||
$$(post_up_cmd-$1)
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define CVS_TMPL
|
||||
DIR-$(notdir $1) := $1
|
||||
ifeq (,$(filter-out $(URL_FILTERS),$2))
|
||||
.PHONY: up-$1
|
||||
updaterepos: up-$1
|
||||
DIR-$(notdir $1) := $1
|
||||
.PHONY: $1/CVS
|
||||
initrepos: $1/CVS
|
||||
$1/CVS:
|
||||
@ -112,9 +127,12 @@ up-$1:
|
||||
@cd $(subst /,$(DIRSEP),$1) >$(NULL) 2>&1 && $(CVS) $(CVSFLAGS) up $(CVSUP_FLAGS)
|
||||
$$(post_up_cmd-$1)
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define GIT_TMPL
|
||||
DIR-$(notdir $1) := $1
|
||||
ifeq (,$(filter-out $(URL_FILTERS),$2))
|
||||
.PHONY: pull-$1
|
||||
updaterepos: pull-$1
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
@ -124,12 +142,11 @@ else
|
||||
.PHONY: $1/.git
|
||||
initrepos: $1/.git
|
||||
endif
|
||||
DIR-$(notdir $1) := $1
|
||||
$1/.git:
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@echo +++ Creating[git]: $(SHQ)'$1$(SHQ)' from $(SHQ)'$2$(SHQ)'
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
ifeq (,$(filter http:% https:%,$2))
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
$(TEST) ! -d $1 || $(RD) $(subst /,$(DIRSEP),$1)
|
||||
endif
|
||||
$(GIT) clone $2 $1
|
||||
@ -142,9 +159,12 @@ pull-$1:
|
||||
@cd $(subst /,$(DIRSEP),$1) >$(NULL) 2>&1 && $(GIT) pull $(GITPULL_FLAGS)
|
||||
$$(post_up_cmd-$1)
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define BZR_TMPL
|
||||
DIR-$(notdir $1) := $1
|
||||
ifeq (,$(filter-out $(URL_FILTERS),$2))
|
||||
.PHONY: pull-$1
|
||||
updaterepos: pull-$1
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
@ -154,12 +174,11 @@ else
|
||||
.PHONY: $1/.bzr
|
||||
initrepos: $1/.bzr
|
||||
endif
|
||||
DIR-$(notdir $1) := $1
|
||||
$1/.bzr:
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@echo +++ Creating[bzr]: $(SHQ)'$1$(SHQ)' from $(SHQ)'$2$(SHQ)'
|
||||
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
ifeq (,$(filter http:% https:%,$2))
|
||||
ifneq (,$(filter http:% https:%,$2))
|
||||
$(TEST) ! -d $1 || $(RD) $(subst /,$(DIRSEP),$1)
|
||||
endif
|
||||
$(BZR) branch $2 $1
|
||||
@ -172,6 +191,7 @@ pull-$1:
|
||||
cd $(subst /,$(DIRSEP),$1) && $(BZR) pull $(BZRPULL_FLAGS)
|
||||
$$(post_up_cmd-$1)
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user