This repository has been archived by the owner on Aug 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
117 lines (95 loc) · 3.34 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
VPATH = functions
BUILD = _build
SCRIPTS = scripts
base_functions = \
autoworkon \
cdsitepackages \
cdvirtualenv \
find_in_parents \
lssitepackages \
lsvirtualenvs \
mkvirtualenv \
rmvirtualenv \
virtualenv_sh_add_hook \
virtualenv_sh_init \
virtualenv_sh_init_features \
virtualenv_sh_remove_hook \
virtualenv_sh_restore_options \
virtualenv_sh_run_global_hook \
virtualenv_sh_run_hook \
virtualenv_sh_run_hook_functions \
virtualenv_sh_run_local_hook \
virtualenv_sh_save_options \
virtualenv_sh_site_packages_path \
virtualenv_sh_verify_active_virtualenv \
virtualenv_sh_verify_workon_home \
virtualenv_sh_virtualenvs \
virtualenv_sh_workon_list \
workon
bash_functions = \
bash/_virtualenv_sh_complete_cdvirtualenv \
bash/_virtualenv_sh_complete_sitepackages \
bash/_virtualenv_sh_complete_virtualenvs \
bash/virtualenv_sh_init_features \
bash/virtualenv_sh_workon_list
zsh_functions = \
zsh/_virtualenv_sh_complete_virtualenvs \
zsh/virtualenv_sh_add_hook \
zsh/virtualenv_sh_complete_cdvirtualenv \
zsh/virtualenv_sh_complete_sitepackages \
zsh/virtualenv_sh_init_features \
zsh/virtualenv_sh_workon_list \
zsh/virtualenv_sh_remove_hook
all: sh bash zsh
sh: build-prep $(SCRIPTS)/virtualenv-sh.sh
$(SCRIPTS)/virtualenv-sh.sh: $(base_functions)
rm $(BUILD)/* || true
for file in $^; do cp $${file} $(BUILD); done
sh bin/build-monolithic.sh $(BUILD)/* > $(SCRIPTS)/virtualenv-sh.sh
@echo
bash: build-prep $(SCRIPTS)/virtualenv-sh.bash
$(SCRIPTS)/virtualenv-sh.bash: $(base_functions) $(bash_functions)
rm $(BUILD)/* || true
for file in $^; do cp $${file} $(BUILD); done
sh bin/build-monolithic.sh $(BUILD)/* > $(SCRIPTS)/virtualenv-sh.bash
@echo
zsh: build-prep $(SCRIPTS)/virtualenv-sh.zsh $(SCRIPTS)/virtualenv-sh.zwc
$(SCRIPTS)/virtualenv-sh.zsh $(SCRIPTS)/virtualenv-sh.zwc: $(base_functions) $(zsh_functions)
rm $(BUILD)/* || true
for file in $^; do cp $${file} $(BUILD); done
sh bin/build-monolithic.sh $(BUILD)/* > $(SCRIPTS)/virtualenv-sh.zsh
if [ $$(which zsh) ]; then zsh -c "zcompile -U $(SCRIPTS)/virtualenv-sh.zwc $(BUILD)/*"; fi
@echo
build-prep:
mkdir -p $(SCRIPTS)
mkdir -p $(BUILD)
install: install-sh install-bash install-zsh
install-sh: sh
cp $(SCRIPTS)/virtualenv-sh.sh /usr/local/bin
install-bash: bash
cp $(SCRIPTS)/virtualenv-sh.bash /usr/local/bin
install-zsh: zsh
cp $(SCRIPTS)/virtualenv-sh.zsh /usr/local/bin
if [ -e $(SCRIPTS)/virtualenv-sh.zwc ]; then cp $(SCRIPTS)/virtualenv-sh.zwc /usr/local/bin; fi
clean:
rm -rf $(BUILD)/* || true
rm -rf $(SCRIPTS)/* || true
test: test-sh test-bash test-ksh test-zsh
test-sh: sh
@echo Testing with $$(which sh)
@cd test; if [ $$(which sh) ]; then sh ./test.sh ../$(SCRIPTS)/virtualenv-sh.sh; else echo "sh is not in the path"; fi
@echo
test-bash: bash
@echo Testing with $$(which bash)
@cd test; if [ $$(which bash) ]; then bash ./test.sh ../$(SCRIPTS)/virtualenv-sh.bash; else echo "bash is not in the path"; fi
@echo
test-ksh: sh
@echo Testing with $$(which ksh)
@cd test; if [ $$(which ksh) ]; then ksh ./test.sh ../$(SCRIPTS)/virtualenv-sh.sh; else echo "ksh is not in the path"; fi
@echo
# The current version of shunit2 doesn't seem to play well with zsh, but here
# it is.
test-zsh: zsh
@echo Testing with $$(which zsh)
@cd test; if [ $$(which zsh) ]; then zsh ./test.sh ../$(SCRIPTS)/virtualenv-sh.zsh; else echo "zsh is not in the path"; fi
@echo