File: Makefile

package info (click to toggle)
vitables 3.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,044 kB
  • sloc: python: 9,695; makefile: 214; sh: 90
file content (87 lines) | stat: -rw-r--r-- 2,487 bytes parent folder | download
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
#       Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved
#       Copyright (C) 2008-2024 Vicent Mas. All rights reserved
#       Author:  Vicent Mas - vmas@vitables.org
#
# This Makefile is intended to create the ViTables installer for Windows.
# It is not intended for distribution.

VERSIONFILE=..\VERSION
#VERSION=$(shell type ..\VERSION) (syntax not supported by nmake)

VERSION=2.2.2

PYTHONVERSION=26
DOTPYTHONVERSION=2.6

ROOT=..
LICENSEFILE=$(ROOT)\LICENSE.txt
LICENSEFILENAME=LICENSE.txt
WINDOWS32=C:\\Windows\\system32

# The NSIS intstaller script
VTNSIS=vitables-py$(DOTPYTHONVERSION).nsi

# ViTables executable script
PYTHON=C:\Python$(PYTHONVERSION)\python
SIB="$(USERPROFILE)\VendorID-1.0.0\sib\sib.py"
ICON=$(ROOT)\vitables\icons\vitables.ico

# Documentation in HTML and PDF formats
INDEX=$(ROOT)\doc\index.rst
HTML_INDEX=$(ROOT)\doc\index_html.txt
PDF_INDEX=$(ROOT)\doc\index_pdf.txt
HTML_OUTDIR=$(ROOT)\vitables\htmldocs
PDF_OUTDIR=$(ROOT)\doc

clean:
	del $(VTNSIS)
	del ViTables*.win32-py$(DOTPYTHONVERSION).exe
	del $(ROOT)\vitables.py
	del $(INDEX)
	del $(ROOT)\doc\UsersGuide.pdf
	rmdir /q /s $(HTML_OUTDIR)
	rmdir /q /s $(ROOT)\doc\_build

vitables.exe:
	copy $(ROOT)\scripts\vitables .\vitables.py
	$(PYTHON) $(SIB) -u -i $(ICON) ./vitables.py
#	$(MAKE) -C build_vitables (syntax not supported by nmake)
	cd build_vitables && $(MAKE)
	copy build_vitables\vitables.exe .
	copy build_vitables\vitables.exe.manifest .
	rmdir /q /s build_vitables
	del .\vitables.py

vtdoc: htmldoc pdfdoc

htmldoc:
	del $(INDEX)
	copy $(HTML_INDEX) $(INDEX)
	cd $(ROOT)\doc && make.bat html
	mkdir $(HTML_OUTDIR)
	xcopy $(ROOT)\doc\_build\html\*.* /E $(HTML_OUTDIR)
	rmdir /q /s $(HTML_OUTDIR)\_sources
	copy $(ROOT)\vitables\LICENSE.html $(HTML_OUTDIR)
	rmdir /q /s $(ROOT)\doc\_build

pdfdoc:
	del $(INDEX)
	copy $(PDF_INDEX) /Y $(INDEX)
	cd $(ROOT)\doc && make.bat pdf
	xcopy $(ROOT)\doc\_build\pdf\*.* $(ROOT)\doc
	rmdir /q /s $(ROOT)\doc\_build

installer: vitables.nsi.in $(VERSIONFILE) $(LICENSEFILE) vtdoc vitables.exe
	copy ..\vitables\LICENSE.html LICENSE.html
	type vitables.nsi.in | sed -e "s/@VERSION@/$(VERSION)/g" \
	-e "s/@PYTHONVERSION@/$(PYTHONVERSION)/g" \
	-e "s/@DOTPYTHONVERSION@/$(DOTPYTHONVERSION)/g" \
	-e "s/@ROOT@/$(ROOT)/g" \
	-e "s/@WINDOWS32@/$(WINDOWS32)/g" \
	-e "s/@LICENSE@/$(LICENSE)/g" \
	-e "s/@LICENSEFILENAME@/$(LICENSEFILENAME)/g" \
	> $(VTNSIS)
	makensis $(VTNSIS)
	del LICENSE.html
	del vitables.exe
	del vitables.exe.manifest