-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkfile
115 lines (95 loc) · 1.86 KB
/
mkfile
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
#
# Makefile for VIM on Plan 9
#
#>>>>> choose options:
### See feature.h for a list of optionals.
# The root directory for resources.
VIMRCLOC=/sys/lib/vim
# The runtime files.
VIMRUNTIMEDIR=$VIMRCLOC/vimfiles
#>>>>> end of choices
###########################################################################
APE=/sys/src/ape
<$APE/config
BIN=/$objtype/bin
TARG=\
vim\
xxd\
VOFILES=\
buffer.$O\
charset.$O\
diff.$O\
digraph.$O\
edit.$O\
eval.$O\
ex_cmds.$O\
ex_cmds2.$O\
ex_docmd.$O\
ex_eval.$O\
ex_getln.$O\
fileio.$O\
fold.$O\
getchar.$O\
hardcopy.$O\
hashtab.$O\
main.$O\
mark.$O\
mbyte.$O\
memfile.$O\
memline.$O\
menu.$O\
message.$O\
misc1.$O\
misc2.$O\
move.$O\
normal.$O\
ops.$O\
option.$O\
os_plan9.$O\
pathdef.$O\
popupmnu.$O\
quickfix.$O\
regexp.$O\
screen.$O\
search.$O\
spell.$O\
syntax.$O\
tag.$O\
term.$O\
ui.$O\
undo.$O\
version.$O\
window.$O\
CLEANFILES=\
pathdef.c\
default:V: all
</sys/src/cmd/mkmany
CFLAGS=-c -D_POSIX_SOURCE -DPLAN9 -D_PLAN9_SOURCE -Iproto
pathdef.$O:VQ:
echo creating pathdef.c...
cat > pathdef.c <<EOF
/* pathdef.c */
#include "vim.h"
char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
char_u *default_vimruntime_dir = (char_u *)"$VIMRUNTIMEDIR";
char_u *all_cflags = (char_u *)"$CC $CFLAGS";
char_u *all_lflags = (char_u *)"$LD -o $O.vim";
char_u *compiled_user = (char_u *)"$user";
char_u *compiled_sys = (char_u *)"$sysname";
EOF
$CC $CFLAGS pathdef.c
# version.c is compiled each time, so that it sets the build time.
version.$O:V:
$CC $CFLAGS version.c
# be stricter on our own code.
os_plan9.$O: os_plan9.c
$CC $CFLAGS -FVw $prereq
$O.vim:V: $VOFILES
$LD -o $target $prereq
$O.xxd: xxd/xxd.c
$CC -D_POSIX_SOURCE -o $target $prereq
install:V: installruntime
installruntime:V:
rm -rf /sys/lib/vim/vimfiles
mkdir -p /sys/lib/vim/vimfiles
dircp lib/vimfiles /sys/lib/vim/vimfiles