blob: e6c872a5232867b9f86359b21dd715b5c33e2243 (
plain)
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
|
#colors
RED=\033[0;31m
GREEN=\033[0;32m
NC=\033[0m # No Color
MAGENTA=\033[0;35m
YELLOW=\033[0;33m
#PROGRAM NAME
PROG1 = setup.py
PROG2 = main.py
SRC = $(wildcard *.py)
SPEC = .spec
DIR = $(shell pwd)
FILES = build *.spec
#COMPILER variable
CC = pyinstaller
CFLAGS = --clean --noconfirm --noconsole --uac-admin -F
#rules and recipes
all: buildmac cleanspec
cleanspec:
@printf "$(YELLOW)Cleaning spec...$(NC)\n"
@rm -rf $(FILES)
@if [ $$? -eq 0 ]; then printf "$(MAGENTA)Files $(FILES) are removed successfully\n"; else printf "$(RED)Error: Files $(FILES) are not removed\n"; fi
buildmac:
@rm -f dist/$(PROG1) dist/$(PROG1).app dist/$(PROG1) dist/$(PROG2).app
@printf "$(YELLOW)In porcess ... to compile the $(GREEN)$(PROG1)${NC}\n"
$(CC) $(CFLAGS) $(PROG1)
@printf "$(YELLOW)In porcess ... to compile the $(GREEN)$(PROG2)${NC}\n"
$(CC) $(CFLAGS) $(PROG2)
@printf "$(YELLOW)$(PROG1) $(PROG2)$(GREEN) compiled successfully${NC}\n"
@mv dist/setup dist/setup-mac
@mv dist/main dist/main-mac
buildlinux:
@rm -f dist/$(PROG1) dist/$(PROG1).app dist/$(PROG1) dist/$(PROG2).app
@printf "$(YELLOW)In porcess ... to compile the $(GREEN)$(PROG1)${NC}\n"
$(CC) $(CFLAGS) $(PROG1)
@printf "$(YELLOW)In porcess ... to compile the $(GREEN)$(PROG2)${NC}\n"
$(CC) $(CFLAGS) $(PROG2)
@printf "$(YELLOW)$(PROG1) $(PROG2)$(GREEN) compiled successfully${NC}\n"
@mv dist/setup dist/setup-linux
@mv dist/main dist/main-linux
run: build
@open ./dist/*
clean: cleanspec
@printf "$(YELLOW)Cleaning...$(NC)\n"
@rm -rf dist
@if [ $$? -eq 0 ]; then printf "$(MAGENTA)Files dist(*) are removed successfully\n"; else printf "$(RED)Error: Files dist(*) are not removed\n"; fi
|