-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile
83 lines (72 loc) · 2.86 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright (C) 2007 Stephen Bach
#
# Permission is hereby granted to use and distribute this code, with or without
# modifications, provided that this copyright notice is copied with it. Like
# anything else that's free, this file is provided *as is* and comes with no
# warranty of any kind, either expressed or implied. In no event will the
# copyright holder be liable for any damages resulting from the use of this
# software.
EXPLORER_VIM_FILE = src/explorer.vim
# Order matters.
EXPLORER_RUBY_FILES = src/vim.rb \
src/lusty.rb \
src/mercury.rb \
src/lusty/entry.rb \
src/lusty/explorer.rb \
src/lusty/buffer-explorer.rb \
src/lusty/filesystem-explorer.rb \
src/lusty/buffer-grep.rb \
src/lusty/prompt.rb \
src/lusty/window.rb \
src/lusty/saved-settings.rb \
src/lusty/display.rb \
src/lusty/file-masks.rb \
src/lusty/vim-swaps.rb \
src/lusty/buffer-stack.rb
JUGGLER_VIM_FILE = src/juggler.vim
# Order matters.
JUGGLER_RUBY_FILES = src/vim.rb \
src/lusty.rb \
src/lusty/juggler.rb \
src/lusty/bar-item.rb \
src/lusty/name-bar.rb \
src/lusty/buffer-stack.rb
all: autoload/lustyexplorer.vim autoload/lustyjuggler.vim
UNAME := $(shell uname)
# OS X's sed doesn't have \< or \b for word boundaries.
ifeq ($(UNAME), Darwin)
LEFT_BOUND = [[:<:]]
RIGHT_BOUND = [[:>:]]
else
LEFT_BOUND = \<
RIGHT_BOUND = \>
endif
# Concatenate the Ruby files, removing redundant copyrights, and insert
# the results into the vimscript files. Change LustyM module references to
# LustyE or LustyJ so that the use of out-of-sync versions of lusty-explorer
# and lusty-juggler is less likely to cause monkey patching issues.
autoload/lustyexplorer.vim: $(EXPLORER_VIM_FILE) $(EXPLORER_RUBY_FILES)
for file in $(EXPLORER_RUBY_FILES); do \
cat $$file | sed '1,/^$$/d' ;\
echo ; \
done | sed 's/$(LEFT_BOUND)LustyM$(RIGHT_BOUND)/LustyE/g' > \
ruby-content.tmp
( sed '/{{RUBY_CODE_INSERTION_POINT}}/,$$d' $(EXPLORER_VIM_FILE) ; \
cat ruby-content.tmp ; \
sed '1,/{{RUBY_CODE_INSERTION_POINT}}/d' $(EXPLORER_VIM_FILE) ) > \
$@
rm -f ruby-content.tmp
autoload/lustyjuggler.vim: $(JUGGLER_VIM_FILE) $(JUGGLER_RUBY_FILES)
for file in $(JUGGLER_RUBY_FILES); do \
cat $$file | sed '1,/^$$/d' ;\
echo ; \
done | sed 's/$(LEFT_BOUND)LustyM$(RIGHT_BOUND)/LustyJ/g' > \
ruby-content.tmp
( sed '/{{RUBY_CODE_INSERTION_POINT}}/,$$d' $(JUGGLER_VIM_FILE) ; \
cat ruby-content.tmp ; \
sed '1,/{{RUBY_CODE_INSERTION_POINT}}/d' $(JUGGLER_VIM_FILE) ) > \
$@
rm -f ruby-content.tmp
clean:
rm -f ruby-content.tmp autoload/lustyexplorer.vim \
autoload/lustyjuggler.vim