-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (54 loc) · 1.79 KB
/
Makefile
File metadata and controls
63 lines (54 loc) · 1.79 KB
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
#
# Makefile for creating a PyCmd.zip binary distribution
# Requires:
# * Python >= 2.7 (32-bit or 64-bit)
# * MinGW (make, rm, cp etc) and python in the %PATH%
# * cx_freeze, pywin32 and pefile installed in the Python dist
#
# Author: Horea Haitonic
#
RM = rm
CP = cp
MV = mv
ZIP = zip
SHELL = cmd
SRC = PyCmd.py InputState.py DirHistory.py common.py completion.py console.py fsm.py
SRC_TEST = common_tests.py
PYTHONHOME_W32 = C:\python\Python27
PYTHONHOME_W64 = C:\python\Python27x64
PYTHON_W32 = (set PYTHONHOME=$(PYTHONHOME_W32)) && "$(PYTHONHOME_W32)\python.exe"
PYTHON_W64 = (set PYTHONHOME=$(PYTHONHOME_W64)) && "$(PYTHONHOME_W64)\python.exe"
ifndef BUILD_INFO
BUILD_INFO = $(shell WMIC os GET LocalDateTime | grep -v Local | cut -c 1-8)
endif
.PHONY: all
all:
# $(MAKE) clean
# $(MAKE) dist_w32
$(MAKE) clean
$(MAKE) dist_w64
doc: pycmd_public.py
$(PYTHON_W64) -c "import pycmd_public, pydoc; pydoc.writedoc('pycmd_public')"
dist_w32: clean $(SRC) doc
echo build_info = '$(BUILD_INFO)' > buildinfo.py
$(PYTHON_W32) setup.py build
$(MV) build\exe.win32-2.7 PyCmd
$(CP) README.txt PyCmd
(echo Release $(BUILD_INFO): && echo. && type NEWS.txt) > PyCmd\NEWS.txt
$(ZIP) -r PyCmd-$(BUILD_INFO)-w32.zip PyCmd
dist_w64: clean $(SRC) doc
echo build_info = '$(BUILD_INFO)' > buildinfo.py
$(PYTHON_W64) setup.py build
$(MV) build\exe.win-amd64-2.7 PyCmd
$(CP) README.txt PyCmd
# cx_freeze on Py64 fails to include pywintypes27.dll:
$(CP) $(PYTHONHOME_W64)\Lib\site-packages\pywin32_system32\pywintypes27.dll PyCmd
(echo Release $(BUILD_INFO): && echo. && type NEWS.txt) > PyCmd\NEWS.txt
$(ZIP) -r PyCmd-$(BUILD_INFO)-w64.zip PyCmd
.PHONY: clean
clean:
$(RM) buildinfo.*
$(RM) $(SRC:%.py=%.pyc)
$(RM) pycmd_public.html
cd tests && $(RM) $(SRC_TEST:%.py=%.pyc) && $(RM) __init__.pyc
$(RM) -r build PyCmd