-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (46 loc) · 1.17 KB
/
Makefile
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
#
#
#
# is Windows_NT on XP, 2000, 7, Vista, 10...
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
# same as "uname -s"
detected_OS := $(shell uname)
endif
APPNAME=cppuml
PACKAGENAME=bdist_rpm
ifeq ($(detected_OS),Windows)
APPNAME=cppuml.exe
PACKAGENAME=bdist_msi
else
ifeq ($(detected_OS),Darwin)
PACKAGENAME=bdist_dmg
endif
endif
all: help
# @echo "$(detected_OS) -> $(PACKAGENAME)"
help:
@echo "make run: run the example script"
@echo "make binary: build an executable for your OS"
@echo "make installer: build a distribution package for your OS"
@echo "make clean: clean any junk. achtung baby."
run:
python main.py
clean:
rm -rf ./build ./dist ./__pycache__
# caution here as there is a wildcard.
rm *.spec *.ini
# make
binary:
pyinstaller --onefile -n$(APPNAME) main.py
#---------unused for2 reference only ----------------------
# exe:
# python setup.py build
# installer:
# python setup.py $(PACKAGENAME)
# think this is not quite as good?
# pyinst:
# pyinstaller --onefile -n$(APPNAME) main.py
# example to show how to add text resources. not so useful.
# pyinstaller --onefile -n$(APPNAME) --add-data "./cppuml.ini;." main.py