This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vim.mk
106 lines (83 loc) · 3.11 KB
/
vim.mk
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
#########################################################
# vim for uClinux
# Mark Hindess Feb 2008
#
# usage: make -f vim.mk vim-package
#
#########################################################
include rules.mk
VIM_SITE=http://downloads.openwrt.org/sources
VIM_VERSION=7.1
VIM_SOURCE=vim-7.1.tar.bz2
VIM_CROSS_COMPILE_SITE=\
http://ftp.osuosl.org/pub/clfs/clfs-packages/sysroot-0.0.1
VIM_CROSS_COMPILE_PATCH=vim-7.1-cross_compile-1.patch
VIM_UNZIP=bzcat
VIM_DIR_BASENAME=vim71
VIM_DIR=$(BUILD_DIR)/$(VIM_DIR_BASENAME)
VIM_CONFIGURE_OPTS=--host=bfin-linux-uclibc --prefix=/usr \
--with-tlib=ncurses --with-features=normal --without-x --disable-netbeans
TARGET_DIR=$(BUILD_DIR)/tmp/vim/ipkg/vim
PKG_NAME:=vim
PKG_VERSION:=$(VIM_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/vim
$(DL_DIR)/$(VIM_SOURCE):
$(WGET) -P $(DL_DIR) $(VIM_SITE)/$(VIM_SOURCE)
$(DL_DIR)/$(VIM_CROSS_COMPILE_PATCH):
$(WGET) -P $(DL_DIR) \
$(VIM_CROSS_COMPILE_SITE)/$(VIM_CROSS_COMPILE_PATCH)
vim-source: $(DL_DIR)/$(VIM_SOURCE) $(DL_DIR)/$(VIM_CROSS_COMPILE_PATCH)
$(VIM_DIR)/.unpacked: $(DL_DIR)/$(VIM_SOURCE) $(DL_DIR)/$(VIM_CROSS_COMPILE_PATCH)
tar -xjvf $(DL_DIR)/$(VIM_SOURCE)
touch $(VIM_DIR)/.unpacked
$(VIM_DIR)/.configured: $(VIM_DIR)/.unpacked
chmod a+x $(VIM_DIR)/configure
cd $(VIM_DIR); patch -p1 <$(DL_DIR)/$(VIM_CROSS_COMPILE_PATCH)
$(PATCH_KERNEL) $(VIM_DIR) patch vim.patch
cd $(VIM_DIR); LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
./configure $(VIM_CONFIGURE_OPTS)
touch $(VIM_DIR)/.configured
vim: $(VIM_DIR)/.configured
make -C $(VIM_DIR)/ STAGEDIR=$(STAGING_DIR)
rm -Rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/bin
mkdir -p $(TARGET_DIR)/usr/share/vim/syntax
cp -f $(VIM_DIR)/src/vim $(TARGET_DIR)/bin/vim
cp -f $(VIM_DIR)/runtime/vimrc_example.vim $(TARGET_DIR)/usr/share/vim/vimrc
cp -f $(VIM_DIR)/runtime/filetype.vim $(TARGET_DIR)/usr/share/vim
cp -f $(VIM_DIR)/runtime/syntax/* $(TARGET_DIR)/usr/share/vim/syntax
cp -f $(BUILD_DIR)/files/asterisk.vim $(TARGET_DIR)/usr/share/vim/syntax
touch $(PKG_BUILD_DIR)/.built
all: vim
vim-dirclean:
rm -rf $(VIM_DIR)
define Package/$(PKG_NAME)
SECTION:=editor
CATEGORY:=Editor
TITLE:=vim
DESCRIPTION:=\
Vim is an almost compatible version of the UNIX editor Vi.
URL:=http://www.vim.org/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
vim-package: vim $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk
#---------------------------------------------------------------------------
# CREATING PATCHES
#---------------------------------------------------------------------------
# Generate patches between vanilla tar ball and our
# version. Run this target after you have made any changes to
# to capture.
AO = $(VIM_DIR_BASENAME)-orig
A = $(VIM_DIR_BASENAME)
vim-make-patch:
# untar original, to save time we check if the orig is already there
if [ ! -d $(VIM_DIR)-orig ] ; then \
cd $(DL_DIR); tar xjf $(VIM_SOURCE); \
mv $(A) $(VIM_DIR)-orig; \
fi
# change default terminal type to one that ip04 has defined
-cd $(BUILD_DIR); diff -uN \
$(AO)/src/term.c \
$(A)/src/term.c \
> $(PWD)/patch/vim.patch