-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
44 lines (35 loc) · 1.21 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
# Variables
PYTHON := python
PIP := $(PYTHON) -m pip
PYINSTALLER := pyinstaller
# Directories
ASSETS_DIR := assets
SRC_DIR := src
ICON := $(ASSETS_DIR)/ReWare.ico
DIST_DIR := dist
BUILD_DIR := build
# Check if the icon exists, otherwise PyInstaller will throw an error
# Only apply icon on Windows
ICON_FLAG = $(shell if [ -f "$(ICON)" ] && [ "$(OS)" = "Windows_NT" ]; then echo "--icon=$(ICON)"; fi)
.PHONY: all install build build-server build-client clean
# Default target
all: install build
# Install dependencies
install:
$(PIP) install --upgrade pip
$(PIP) install colorama keyboard mouse mss pillow pyinstaller websockets
# Build both applications
build: build-server build-client
# Build the Server/GUI (Windowed, no console popup)
build-server:
@echo "Building Server/GUI..."
$(PYINSTALLER) --noconfirm --onefile --windowed $(ICON_FLAG) --name "ReWare GUI" --hidden-import="PIL._tkinter_finder" $(SRC_DIR)/main.py
# Build the Client (Console app)
build-client:
@echo "Building Client..."
$(PYINSTALLER) --noconfirm --onefile --console $(ICON_FLAG) --name "ReWare Client" $(SRC_DIR)/client.py
# Clean up build artifacts
clean:
@echo "Cleaning up..."
rm -rf $(DIST_DIR) $(BUILD_DIR) *.spec
rm -rf __pycache__