xref: /vim-8.2.3635/Makefile (revision f4cd3e80)
1# This Makefile has two purposes:
2# 1. Starting the compilation of Vim for Unix.
3# 2. Creating the various distribution files.
4
5
6# 1. Using this Makefile without an argument will compile Vim for Unix.
7#
8# "make install" is also possible.
9#
10# NOTE: If this doesn't work properly, first change directory to "src" and use
11# the Makefile there:
12#	cd src
13#	make [arguments]
14# Noticed on AIX systems when using this Makefile: Trying to run "cproto" or
15# something else after Vim has been compiled.  Don't know why...
16# Noticed on OS/390 Unix: Restarts configure.
17#
18# The first (default) target is "first".  This will result in running
19# "make first", so that the target from "src/auto/config.mk" is picked
20# up properly when config didn't run yet.  Doing "make all" before configure
21# has run can result in compiling with $(CC) empty.
22
23first:
24	@echo "Starting make in the src directory."
25	@echo "If there are problems, cd to the src directory and run make there"
26	cd src && $(MAKE) $@
27
28# Some make programs use the last target for the $@ default; put the other
29# targets separately to always let $@ expand to "first" by default.
30all install uninstall tools config configure proto depend lint tags types test testclean clean distclean:
31	@echo "Starting make in the src directory."
32	@echo "If there are problems, cd to the src directory and run make there"
33	cd src && $(MAKE) $@
34
35
36# 2. Create the various distributions:
37#
38# TARGET	PRODUCES		CONTAINS
39# unixall	vim-#.#.tar.bz2		Runtime files and Sources for Unix
40#
41# extra		vim-#.#-extra.tar.gz	Extra source and runtime files
42# lang		vim-#.#-lang.tar.gz	multi-language files
43#
44# html		vim##html.zip		HTML docs
45#
46# amisrc	vim##src.tgz		sources for Amiga
47# amirt		vim##rt.tgz		runtime for Amiga
48# amibin	vim##bin.tgz		binary for Amiga
49#
50# dossrc	vim##src.zip		sources for MS-DOS
51# dosrt		vim##rt.zip		runtime for MS-DOS
52# dosbin	vim##d16.zip		binary for MS-DOS 16 bits
53#		vim##d32.zip		binary for MS-DOS 32 bits
54#		vim##w32.zip		binary for Win32
55#		gvim##.zip		binary for GUI Win32
56#		gvim##ole.zip		OLE exe for Win32 GUI
57#		gvim##_s.zip		exe for Win32s GUI
58# doslang	vim##lang.zip		language files for Win32
59#
60# os2bin	vim##os2.zip		binary for OS/2
61#					(use RT from dosrt)
62#
63# farsi		farsi##.zip		Farsi fonts
64#
65#    All output files are created in the "dist" directory.  Existing files are
66#    overwritten!
67#    To do all this you need the unix, extra and lang archives, and
68#    compiled binaries.
69#    Before creating an archive first delete all backup files, *.orig, etc.
70
71MAJOR = 7
72MINOR = 0aa
73
74# Uncomment this line if the Win32s version is to be included.
75#DOSBIN_S =  dosbin_s
76
77# CHECKLIST for creating a new version:
78#
79# - Update Vim version number.  For a test version in: src/version.h, Contents,
80#   MAJOR/MINOR above, VIMRTDIR and VERSION in src/Makefile, README*.txt,
81#   runtime/doc/*.txt and nsis/gvim.nsi. Other things in README_os2.txt.  For a
82#   minor/major version: src/GvimExt/GvimExt.reg, src/vim.def, src/vim16.def.
83# - Correct included_patches[] in src/version.c.
84# - Compile Vim with GTK, Perl, Python, TCL, Ruby, MZscheme, Cscope and "huge"
85#   features.  Exclude workshop and SNiFF.
86# - With these features: "make proto" (requires cproto and Motif installed;
87#   ignore warnings for missing include files, fix problems for syntax errors).
88# - With these features: "make depend" (works best with gcc).
89# - "make lint" and check the output (ignore GTK warnings).
90# - Enable the efence library in "src/Makefile" and run "make test".  May
91#   require disabling Python to avoid trouble with threads.
92# - Check for missing entries in runtime/makemenu.vim (with checkmenu script).
93# - Check for missing options in runtime/optwin.vim et al. (with check.vim).
94# - Do "make menu" to update the runtime/synmenu.vim file.
95# - Add remarks for changes to runtime/doc/version6.txt.
96# - In runtime/doc run "make" and "make html" to check for errors.
97# - Check if src/Makefile and src/feature.h don't contain any personal
98#   preferences or the GTK, Perl, etc. mentioned above.
99# - Check that runtime/doc/help.txt doesn't contain entries in "LOCAL
100#   ADDITIONS".
101# - Check file protections to be "644" for text and "755" for executables (run
102#   the "check" script).
103# - Check compiling on Amiga, MS-DOS and MS-Windows.
104# - Delete all *~, *.sw?, *.orig, *.rej files
105# - "make unixall", "make extra", "make lang", "make html"
106#
107# Amiga:
108# - "make amisrc", move the archive to the Amiga and compile:
109#   "make -f Make_manx.mak" (will use "big" features by default).
110# - Run the tests: "make -f Make_manx.mak test"
111# - Place the executables Vim and Xxd in this directory (set the executable
112#   flag).
113# - "make amirt", "make amibin".
114#
115# PC:
116# - "make dossrc" and "make dosrt".  Unpack the archives on a PC.
117# 16 bit DOS version:
118# - Set environment for compiling with Borland C++ 3.1.
119# - "bmake -f Make_bc3.mak BOR=E:\borlandc" (compiling xxd might fail, in that
120#   case set environment for compiling with Borland C++ 4.0 and do
121#   "make -f make_bc3.mak BOR=E:\BC4 xxd/xxd.exe").
122# - "make test" and check the output.
123# - Rename the executables to "vimd16.exe", "xxdd16.exe", "installd16.exe" and
124#   "uninstald16.exe".
125# 32 bit DOS version:
126# - Set environment for compiling with DJGPP; "gmake -f Make_djg.mak".
127# - "rm testdir/*.out", "gmake -f Make_djg.mak test" and check the output.
128# - Rename the executables to "vimd32.exe", "xxdd32.exe", "installd32.exe" and
129#   "uninstald32.exe".
130# Win32 console version:
131# - Set environment for Visual C++ 5.0: "vcvars32"
132# - "nmake -f Make_mvc.mak"
133# - "rm testdir/*.out", "nmake -f Make_mvc.mak test" and check the output.
134# - Rename the executables to "vimw32.exe", "xxdw32.exe".
135# - When building the Win32s version later, delete vimrun.exe, install.exe and
136#   uninstal.exe.  Otherwise rename executables to installw32.exe and
137#   uninstalw32.exe.
138# Win32 GUI version:
139# - "nmake -f Make_mvc.mak GUI=yes.
140# - move "gvim.exe" to here (otherwise the OLE version will overwrite it).
141# - Delete vimrun.exe, install.exe and uninstall.exe.
142# - Copy "GvimExt/gvimext.dll" to here.
143# Win32 GUI version with OLE, PERL, TCL, PYTHON and dynamic IME:
144# - Run src/bigvim.bat ("nmake -f Make_mvc.mak GUI=yes OLE=yes IME=yes ...)
145# - Rename "gvim.exe" to "gvim_ole.exe".
146# - Delete install.exe and uninstall.exe.
147# - If building the Win32s version delete vimrun.exe.
148# Win32s GUI version:
149# - Set environment for Visual C++ 4.1 (requires a new console window)
150# - "vcvars32" (use the path for VC 4.1 e:\msdev\bin)
151# - "nmake -f Make_mvc.mak GUI=yes INTL=no clean" (use the path for VC 4.1)
152# - "nmake -f Make_mvc.mak GUI=yes INTL=no" (use the path for VC 4.1)
153# - Rename "gvim.exe" to "gvim_w32s.exe".
154# - Rename "install.exe" to "installw32.exe"
155# - Rename "uninstal.exe" to "uninstalw32.exe"
156# - The produced uninstalw32.exe and vimrun.exe are used.
157# Create the archives:
158# - Copy all the "*.exe" files to where this Makefile is.
159# - "make dosbin".
160# - Run make on Unix to update the ".mo" files.
161# - "make doslang".
162# NSIS self installing exe:
163# - Unpack the doslang archive on the PC.
164# - Make sure gvim_ole.exe, vimd32.exe, vimw32.exe, installw32.exe,
165#   uninstalw32.exe and xxdw32.exe have been build as mentioned above.
166# - put gvimext.dll in src/GvimExt and VisVim.dll in src/VisVim (get them
167#   from a binary archive or build them)
168# - make sure there is a diff.exe two levels up
169# - go to ../nsis and do "makensis gvim.nsi".
170# - Copy gvim##.exe to the dist directory.
171#
172# OS/2:
173# - Unpack the Unix "src", "extra" and "rt" archives.
174# - "make -f Make_os2.mak".
175# - Rename the executables to vimos2.exe, xxdos2.exe and teeos2.exe and copy
176#   them to here.
177# - "make os2bin".
178
179VIMVER	= vim-$(MAJOR).$(MINOR)
180VERSION = $(MAJOR)$(MINOR)
181VDOT	= $(MAJOR).$(MINOR)
182VIMRTDIR = vim$(VERSION)
183
184# Vim used for conversion from "unix" to "dos"
185VIM	= vim
186
187# How to include Filelist depends on the version of "make" you have.
188# If the current choice doesn't work, try the other one.
189
190include Filelist
191#.include "Filelist"
192
193
194# All output is put in the "dist" directory.
195dist:
196	mkdir dist
197
198# Clean up some files to avoid they are included.
199prepare:
200	if test -f runtime/doc/uganda.nsis.txt; then \
201		rm runtime/doc/uganda.nsis.txt; fi
202
203# For the zip files we need to create a file with the comment line
204dist/comment:
205	mkdir dist/comment
206
207COMMENT_RT = comment/$(VERSION)-rt
208COMMENT_RT1 = comment/$(VERSION)-rt1
209COMMENT_RT2 = comment/$(VERSION)-rt2
210COMMENT_D16 = comment/$(VERSION)-bin-d16
211COMMENT_D32 = comment/$(VERSION)-bin-d32
212COMMENT_W32 = comment/$(VERSION)-bin-w32
213COMMENT_GVIM = comment/$(VERSION)-bin-gvim
214COMMENT_OLE = comment/$(VERSION)-bin-ole
215COMMENT_W32S = comment/$(VERSION)-bin-w32s
216COMMENT_SRC = comment/$(VERSION)-src
217COMMENT_OS2 = comment/$(VERSION)-bin-os2
218COMMENT_HTML = comment/$(VERSION)-html
219COMMENT_FARSI = comment/$(VERSION)-farsi
220COMMENT_LANG = comment/$(VERSION)-lang
221
222dist/$(COMMENT_RT): dist/comment
223	echo "Vim - Vi IMproved - v$(VDOT) runtime files for MS-DOS and MS-Windows" > dist/$(COMMENT_RT)
224
225dist/$(COMMENT_RT1): dist/comment
226	echo "Vim - Vi IMproved - v$(VDOT) runtime files (PART 1) for MS-DOS and MS-Windows" > dist/$(COMMENT_RT1)
227
228dist/$(COMMENT_RT2): dist/comment
229	echo "Vim - Vi IMproved - v$(VDOT) runtime files (PART 2) for MS-DOS and MS-Windows" > dist/$(COMMENT_RT2)
230
231dist/$(COMMENT_D16): dist/comment
232	echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-DOS 16 bit real mode" > dist/$(COMMENT_D16)
233
234dist/$(COMMENT_D32): dist/comment
235	echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-DOS 32 bit protected mode" > dist/$(COMMENT_D32)
236
237dist/$(COMMENT_W32): dist/comment
238	echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-Windows NT/95" > dist/$(COMMENT_W32)
239
240dist/$(COMMENT_GVIM): dist/comment
241	echo "Vim - Vi IMproved - v$(VDOT) GUI binaries for MS-Windows NT/95" > dist/$(COMMENT_GVIM)
242
243dist/$(COMMENT_OLE): dist/comment
244	echo "Vim - Vi IMproved - v$(VDOT) MS-Windows GUI binaries with OLE support" > dist/$(COMMENT_OLE)
245
246dist/$(COMMENT_W32S): dist/comment
247	echo "Vim - Vi IMproved - v$(VDOT) GUI binaries for MS-Windows 3.1/3.11" > dist/$(COMMENT_W32S)
248
249dist/$(COMMENT_SRC): dist/comment
250	echo "Vim - Vi IMproved - v$(VDOT) sources for MS-DOS and MS-Windows" > dist/$(COMMENT_SRC)
251
252dist/$(COMMENT_OS2): dist/comment
253	echo "Vim - Vi IMproved - v$(VDOT) binaries + runtime files for OS/2" > dist/$(COMMENT_OS2)
254
255dist/$(COMMENT_HTML): dist/comment
256	echo "Vim - Vi IMproved - v$(VDOT) documentation in HTML" > dist/$(COMMENT_HTML)
257
258dist/$(COMMENT_FARSI): dist/comment
259	echo "Vim - Vi IMproved - v$(VDOT) Farsi language files" > dist/$(COMMENT_FARSI)
260
261dist/$(COMMENT_LANG): dist/comment
262	echo "Vim - Vi IMproved - v$(VDOT) MS-Windows language files" > dist/$(COMMENT_LANG)
263
264unixall: dist prepare
265	-rm -f dist/$(VIMVER).tar.bz2
266	-rm -rf dist/$(VIMRTDIR)
267	mkdir dist/$(VIMRTDIR)
268	tar cf - \
269		$(RT_ALL) \
270		$(RT_ALL_BIN) \
271		$(RT_UNIX) \
272		$(RT_UNIX_DOS_BIN) \
273		$(RT_SCRIPTS) \
274		$(LANG_GEN) \
275		$(LANG_GEN_BIN) \
276		$(SRC_ALL) \
277		$(SRC_UNIX) \
278		$(SRC_DOS_UNIX) \
279		| (cd dist/$(VIMRTDIR); tar xf -)
280# Need to use a "distclean" config.mk file
281	cp -f src/config.mk.dist dist/$(VIMRTDIR)/src/auto/config.mk
282# Create an empty config.h file, make dependencies require it
283	touch dist/$(VIMRTDIR)/src/auto/config.h
284# Make sure configure is newer than config.mk to force it to be generated
285	touch dist/$(VIMRTDIR)/src/configure
286	cd dist && tar cf $(VIMVER).tar $(VIMRTDIR)
287	bzip2 dist/$(VIMVER).tar
288
289extra: dist prepare
290	-rm -f dist/$(VIMVER)-extra.tar.gz
291	-rm -rf dist/$(VIMRTDIR)
292	mkdir dist/$(VIMRTDIR)
293	tar cf - \
294		$(EXTRA) \
295		| (cd dist/$(VIMRTDIR); tar xf -)
296	cd dist && tar cf $(VIMVER)-extra.tar $(VIMRTDIR)
297	gzip -9 dist/$(VIMVER)-extra.tar
298
299lang: dist prepare
300	-rm -f dist/$(VIMVER)-lang.tar.gz
301	-rm -rf dist/$(VIMRTDIR)
302	mkdir dist/$(VIMRTDIR)
303	tar cf - \
304		$(LANG_SRC) \
305		| (cd dist/$(VIMRTDIR); tar xf -)
306# Make sure ja.sjis.po is newer than ja.po to avoid it being regenerated.
307# Same for cs.cp1250.po, pl.cp1250.po and sk.cp1250.po.
308	touch dist/$(VIMRTDIR)/src/po/ja.sjis.po
309	touch dist/$(VIMRTDIR)/src/po/cs.cp1250.po
310	touch dist/$(VIMRTDIR)/src/po/pl.cp1250.po
311	touch dist/$(VIMRTDIR)/src/po/sk.cp1250.po
312	touch dist/$(VIMRTDIR)/src/po/zh_CN.cp936.po
313	touch dist/$(VIMRTDIR)/src/po/ru.cp1251.po
314	touch dist/$(VIMRTDIR)/src/po/uk.cp1251.po
315	cd dist && tar cf $(VIMVER)-lang.tar $(VIMRTDIR)
316	gzip -9 dist/$(VIMVER)-lang.tar
317
318amirt: dist prepare
319	-rm -f dist/vim$(VERSION)rt.tar.gz
320	-rm -rf dist/Vim
321	mkdir dist/Vim
322	mkdir dist/Vim/$(VIMRTDIR)
323	tar cf - \
324		$(ROOT_AMI) \
325		$(RT_ALL) \
326		$(RT_ALL_BIN) \
327		$(RT_SCRIPTS) \
328		$(RT_AMI) \
329		$(RT_NO_UNIX) \
330		$(RT_AMI_DOS) \
331		| (cd dist/Vim/$(VIMRTDIR); tar xf -)
332	mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
333	mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
334	mv dist/Vim/$(VIMRTDIR)/runtime/* dist/Vim/$(VIMRTDIR)
335	rmdir dist/Vim/$(VIMRTDIR)/runtime
336	cd dist && tar cf vim$(VERSION)rt.tar Vim Vim.info
337	gzip -9 dist/vim$(VERSION)rt.tar
338	mv dist/vim$(VERSION)rt.tar.gz dist/vim$(VERSION)rt.tgz
339
340amibin: dist prepare
341	-rm -f dist/vim$(VERSION)bin.tar.gz
342	-rm -rf dist/Vim
343	mkdir dist/Vim
344	mkdir dist/Vim/$(VIMRTDIR)
345	tar cf - \
346		$(ROOT_AMI) \
347		$(BIN_AMI) \
348		Vim \
349		Xxd \
350		| (cd dist/Vim/$(VIMRTDIR); tar xf -)
351	mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
352	mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
353	cd dist && tar cf vim$(VERSION)bin.tar Vim Vim.info
354	gzip -9 dist/vim$(VERSION)bin.tar
355	mv dist/vim$(VERSION)bin.tar.gz dist/vim$(VERSION)bin.tgz
356
357amisrc: dist prepare
358	-rm -f dist/vim$(VERSION)src.tar.gz
359	-rm -rf dist/Vim
360	mkdir dist/Vim
361	mkdir dist/Vim/$(VIMRTDIR)
362	tar cf - \
363		$(ROOT_AMI) \
364		$(SRC_ALL) \
365		$(SRC_AMI) \
366		$(SRC_AMI_DOS) \
367		| (cd dist/Vim/$(VIMRTDIR); tar xf -)
368	mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
369	mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
370	cd dist && tar cf vim$(VERSION)src.tar Vim Vim.info
371	gzip -9 dist/vim$(VERSION)src.tar
372	mv dist/vim$(VERSION)src.tar.gz dist/vim$(VERSION)src.tgz
373
374no_title.vim: Makefile
375	echo "set notitle noicon nocp nomodeline viminfo=" >no_title.vim
376
377dosrt: dist dist/$(COMMENT_RT) dosrt_unix2dos
378	-rm -rf dist/vim$(VERSION)rt.zip
379	cd dist && zip -9 -rD -z vim$(VERSION)rt.zip vim <$(COMMENT_RT)
380
381# Split in two parts to avoid a "argument list too long" error.
382dosrt_unix2dos: dist prepare no_title.vim
383	-rm -rf dist/vim
384	mkdir dist/vim
385	mkdir dist/vim/$(VIMRTDIR)
386	tar cf - \
387		$(RT_ALL) \
388		| (cd dist/vim/$(VIMRTDIR); tar xf -)
389	tar cf - \
390		$(RT_SCRIPTS) \
391		$(RT_DOS) \
392		$(RT_NO_UNIX) \
393		$(RT_AMI_DOS) \
394		$(LANG_GEN) \
395		| (cd dist/vim/$(VIMRTDIR); tar xf -)
396	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
397	tar cf - \
398		$(RT_UNIX_DOS_BIN) \
399		$(RT_ALL_BIN) \
400		$(RT_DOS_BIN) \
401		$(LANG_GEN_BIN) \
402		| (cd dist/vim/$(VIMRTDIR); tar xf -)
403	mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR)
404	rmdir dist/vim/$(VIMRTDIR)/runtime
405
406
407# Convert runtime files from Unix fileformat to dos fileformat.
408# Used before uploading.  Don't delete the AAPDIR/sign files!
409runtime_unix2dos: dosrt_unix2dos
410	-rm -rf `find runtime/dos -type f -print | sed -e /AAPDIR/d`
411	cd dist/vim/$(VIMRTDIR); tar cf - * \
412		| (cd ../../../runtime/dos; tar xf -)
413
414dosbin: prepare dosbin_gvim dosbin_w32 dosbin_d32 dosbin_d16 dosbin_ole $(DOSBIN_S)
415
416# make Win32 gvim
417dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM)
418	-rm -rf dist/gvim$(VERSION).zip
419	-rm -rf dist/vim
420	mkdir dist/vim
421	mkdir dist/vim/$(VIMRTDIR)
422	tar cf - \
423		$(BIN_DOS) \
424		| (cd dist/vim/$(VIMRTDIR); tar xf -)
425	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
426	cp gvim.exe dist/vim/$(VIMRTDIR)/gvim.exe
427	cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
428	cp vimrun.exe dist/vim/$(VIMRTDIR)/vimrun.exe
429	cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
430	cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
431	cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
432	cd dist && zip -9 -rD -z gvim$(VERSION).zip vim <$(COMMENT_GVIM)
433
434# make Win32 console
435dosbin_w32: dist no_title.vim dist/$(COMMENT_W32)
436	-rm -rf dist/vim$(VERSION)w32.zip
437	-rm -rf dist/vim
438	mkdir dist/vim
439	mkdir dist/vim/$(VIMRTDIR)
440	tar cf - \
441		$(BIN_DOS) \
442		| (cd dist/vim/$(VIMRTDIR); tar xf -)
443	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
444	cp vimw32.exe dist/vim/$(VIMRTDIR)/vim.exe
445	cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
446	cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
447	cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
448	cd dist && zip -9 -rD -z vim$(VERSION)w32.zip vim <$(COMMENT_W32)
449
450# make 32bit DOS
451dosbin_d32: dist no_title.vim dist/$(COMMENT_D32)
452	-rm -rf dist/vim$(VERSION)d32.zip
453	-rm -rf dist/vim
454	mkdir dist/vim
455	mkdir dist/vim/$(VIMRTDIR)
456	tar cf - \
457		$(BIN_DOS) \
458		| (cd dist/vim/$(VIMRTDIR); tar xf -)
459	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
460	cp vimd32.exe dist/vim/$(VIMRTDIR)/vim.exe
461	cp xxdd32.exe dist/vim/$(VIMRTDIR)/xxd.exe
462	cp installd32.exe dist/vim/$(VIMRTDIR)/install.exe
463	cp uninstald32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
464	cp csdpmi4b.zip dist/vim/$(VIMRTDIR)
465	cd dist && zip -9 -rD -z vim$(VERSION)d32.zip vim <$(COMMENT_D32)
466
467# make 16bit DOS
468dosbin_d16: dist no_title.vim dist/$(COMMENT_D16)
469	-rm -rf dist/vim$(VERSION)d16.zip
470	-rm -rf dist/vim
471	mkdir dist/vim
472	mkdir dist/vim/$(VIMRTDIR)
473	tar cf - \
474		$(BIN_DOS) \
475		| (cd dist/vim/$(VIMRTDIR); tar xf -)
476	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
477	cp vimd16.exe dist/vim/$(VIMRTDIR)/vim.exe
478	cp xxdd16.exe dist/vim/$(VIMRTDIR)/xxd.exe
479	cp installd16.exe dist/vim/$(VIMRTDIR)/install.exe
480	cp uninstald16.exe dist/vim/$(VIMRTDIR)/uninstal.exe
481	cd dist && zip -9 -rD -z vim$(VERSION)d16.zip vim <$(COMMENT_D16)
482
483# make Win32 gvim with OLE
484dosbin_ole: dist no_title.vim dist/$(COMMENT_OLE)
485	-rm -rf dist/gvim$(VERSION)ole.zip
486	-rm -rf dist/vim
487	mkdir dist/vim
488	mkdir dist/vim/$(VIMRTDIR)
489	tar cf - \
490		$(BIN_DOS) \
491		| (cd dist/vim/$(VIMRTDIR); tar xf -)
492	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
493	cp gvim_ole.exe dist/vim/$(VIMRTDIR)/gvim.exe
494	cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
495	cp vimrun.exe dist/vim/$(VIMRTDIR)/vimrun.exe
496	cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
497	cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
498	cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
499	cp README_ole.txt dist/vim/$(VIMRTDIR)
500	cp src/VisVim/VisVim.dll dist/vim/$(VIMRTDIR)/VisVim.dll
501	cp src/VisVim/README_VisVim.txt dist/vim/$(VIMRTDIR)
502	cd dist && zip -9 -rD -z gvim$(VERSION)ole.zip vim <$(COMMENT_OLE)
503
504# make Win32s gvim
505dosbin_s: dist no_title.vim dist/$(COMMENT_W32S)
506	-rm -rf dist/gvim$(VERSION)_s.zip
507	-rm -rf dist/vim
508	mkdir dist/vim
509	mkdir dist/vim/$(VIMRTDIR)
510	tar cf - \
511		$(BIN_DOS) \
512		| (cd dist/vim/$(VIMRTDIR); tar xf -)
513	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
514	cp gvim_w32s.exe dist/vim/$(VIMRTDIR)/gvim.exe
515	cp xxdd32.exe dist/vim/$(VIMRTDIR)/xxd.exe
516	cp README_w32s.txt dist/vim/$(VIMRTDIR)
517	cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
518	cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
519	cd dist && zip -9 -rD -z gvim$(VERSION)_s.zip vim <$(COMMENT_W32S)
520
521# make Win32 lang archive
522doslang: dist prepare no_title.vim dist/$(COMMENT_LANG)
523	-rm -rf dist/vim$(VERSION)lang.zip
524	-rm -rf dist/vim
525	mkdir dist/vim
526	mkdir dist/vim/$(VIMRTDIR)
527	mkdir dist/vim/$(VIMRTDIR)/lang
528	cd src && MAKEMO=yes $(MAKE) languages
529	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
530# Add the message translations.  Trick: skip ja.mo and use ja.sjis.mo instead.
531# Same for cs.mo / cs.cp1250.mo, pl.mo / pl.cp1250.mo, sk.mo / sk.cp1250.mo,
532# zh_CN.mo / zh_CN.cp936.mo, uk.mo / uk.cp1251.mo and ru.mo / ru.cp1251.mo.
533	for i in $(LANG_DOS); do \
534	      if test "$$i" != "src/po/ja.mo" -a "$$i" != "src/po/pl.mo" -a "$$i" != "src/po/cs.mo" -a "$$i" != "src/po/sk.mo" -a "$$i" != "src/po/zh_CN.mo" -a "$$i" != "src/po/ru.mo" -a "$$i" != "src/po/uk.mo"; then \
535		n=`echo $$i | sed -e "s+src/po/\([-a-zA-Z0-9_]*\(.UTF-8\)*\)\(.sjis\)*\(.cp1250\)*\(.cp1251\)*\(.cp936\)*.mo+\1+"`; \
536		mkdir dist/vim/$(VIMRTDIR)/lang/$$n; \
537		mkdir dist/vim/$(VIMRTDIR)/lang/$$n/LC_MESSAGES; \
538		cp $$i dist/vim/$(VIMRTDIR)/lang/$$n/LC_MESSAGES/vim.mo; \
539	      fi \
540	    done
541	cp libintl.dll dist/vim/$(VIMRTDIR)/
542	cd dist && zip -9 -rD -z vim$(VERSION)lang.zip vim <$(COMMENT_LANG)
543
544# MS-DOS sources
545dossrc: dist no_title.vim dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt
546	-rm -rf dist/vim$(VERSION)src.zip
547	-rm -rf dist/vim
548	mkdir dist/vim
549	mkdir dist/vim/$(VIMRTDIR)
550	tar cf - \
551		$(SRC_ALL) \
552		$(SRC_DOS) \
553		$(SRC_AMI_DOS) \
554		$(SRC_DOS_UNIX) \
555		runtime/doc/uganda.nsis.txt \
556		| (cd dist/vim/$(VIMRTDIR); tar xf -)
557	mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR)
558	rmdir dist/vim/$(VIMRTDIR)/runtime
559	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
560	tar cf - \
561		$(SRC_DOS_BIN) \
562		| (cd dist/vim/$(VIMRTDIR); tar xf -)
563	cd dist && zip -9 -rD -z vim$(VERSION)src.zip vim <$(COMMENT_SRC)
564
565runtime/doc/uganda.nsis.txt: runtime/doc/uganda.txt
566	cd runtime/doc && $(MAKE) uganda.nsis.txt
567
568os2bin: dist no_title.vim dist/$(COMMENT_OS2)
569	-rm -rf dist/vim$(VERSION)os2.zip
570	-rm -rf dist/vim
571	mkdir dist/vim
572	mkdir dist/vim/$(VIMRTDIR)
573	tar cf - \
574		$(BIN_OS2) \
575		| (cd dist/vim/$(VIMRTDIR); tar xf -)
576	find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
577	cp vimos2.exe dist/vim/$(VIMRTDIR)/vim.exe
578	cp xxdos2.exe dist/vim/$(VIMRTDIR)/xxd.exe
579	cp teeos2.exe dist/vim/$(VIMRTDIR)/tee.exe
580	cp emx.dll emxlibcs.dll dist/vim/$(VIMRTDIR)
581	cd dist && zip -9 -rD -z vim$(VERSION)os2.zip vim <$(COMMENT_OS2)
582
583html: dist dist/$(COMMENT_HTML)
584	-rm -rf dist/vim$(VERSION)html.zip
585	cd runtime/doc && zip -9 -z ../../dist/vim$(VERSION)html.zip *.html <../../dist/$(COMMENT_HTML)
586
587farsi: dist dist/$(COMMENT_FARSI)
588	-rm -f dist/farsi$(VERSION).zip
589	zip -9 -rD -z dist/farsi$(VERSION).zip farsi < dist/$(COMMENT_FARSI)
590