From 28f2499da374f4586234719f4023a90083ece63e Mon Sep 17 00:00:00 2001 From: ccppi Date: Fri, 9 Aug 2024 09:33:40 +0200 Subject: [PATCH] add a makefile --- build.sh | 2 -- gui.spec | 16 +++++++++++----- makefile | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) delete mode 100644 build.sh create mode 100644 makefile diff --git a/build.sh b/build.sh deleted file mode 100644 index 7f6fdd2..0000000 --- a/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#Works but is fucking big -pyinstaller lib/gui.py --onefile --add-data ./db/:./db diff --git a/gui.spec b/gui.spec index 6213f3b..12728d1 100644 --- a/gui.spec +++ b/gui.spec @@ -5,7 +5,7 @@ a = Analysis( ['lib/gui.py'], pathex=[], binaries=[], - datas=[('./db/', './db')], + datas=[], hiddenimports=[], hookspath=[], hooksconfig={}, @@ -19,16 +19,13 @@ pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, - a.binaries, - a.datas, [], + exclude_binaries=True, name='gui', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, - upx_exclude=[], - runtime_tmpdir=None, console=True, disable_windowed_traceback=False, argv_emulation=False, @@ -36,3 +33,12 @@ exe = EXE( codesign_identity=None, entitlements_file=None, ) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='gui', +) diff --git a/makefile b/makefile new file mode 100644 index 0000000..f9926df --- /dev/null +++ b/makefile @@ -0,0 +1,22 @@ +#Works but is fucking big +#Single file version: +#pyinstaller lib/gui.py --onefile --add-data ./db/:./db + +all:gui cli datafiles + +gui: + pyinstaller lib/gui.py + make datafiles +cli: + pyinstaller lib/main.py + make datafiles +datafiles: + make db-dir + cp ./db/Cantons.db dist/db/ + cp ./db/sqlite3.db dist/db/ + cp ./lib/conf dist/gui/ +db-dir: + mkdir -p dist/db + +clean: + rm dist/db -r