-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (63 loc) · 2.47 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
CC=gcc
CFLAGS= -std=c99 -Wall -Wextra -g -pthread -v -O2
CLANG = clang
FORMATTER = clang-format
SRC_DIR=src
OBJ_DIR=obj
SOURCES=$(wildcard $(SRC_DIR)/*.c)
OBJECTS=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SOURCES))
VERSION=1.0.1
RED=\033[0;31m
GREEN=\033[0;32m
YELLOW=\033[1;33m
BLUE=\033[0;34m
RESET=\033[0m
LOGO=\n\n${RED}▄▄▌ ▄▄ • ▪ ▐ ▄ .▄▄ · ▪ ▄▄ • ▄ .▄▄▄▄▄▄\n██• ▪ ▐█ ▀ ▪██ •█▌▐█▐█ ▀. ██ ▐█ ▀ ▪██▪▐█•██ \n██▪ ▄█▀▄ ▄█ ▀█▄▐█·▐█▐▐▌▄▀▀▀█▄▐█·▄█ ▀█▄██▀▐█ ▐█.▪\n▐█▌▐▌▐█▌.▐▌▐█▄▪▐█▐█▌██▐█▌▐█▄▪▐█▐█▌▐█▄▪▐███▌▐▀ ▐█▌·\n.▀▀▀ ▀█▄▀▪·▀▀▀▀ ▀▀▀▀▀ █▪ ▀▀▀▀ ▀▀▀·▀▀▀▀ ▀▀▀ · ▀▀▀\n${RED} LogInsight v$(VERSION)\n\n
all: $(OBJECTS)
@mkdir -p $(OBJ_DIR) # Ensure obj directory exists
$(CC) $(CFLAGS) -o LogInsight $(OBJECTS)
@echo -e "${LOGO}"
@echo -e "${YELLOW} 🗲 Created by Nighty3098"
@echo -e "${YELLOW} https://nighty3098.github.io/"
@echo -e ""
@echo -e ""
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(OBJ_DIR) # Ensure obj directory exists
$(CC) $(CFLAGS) -c $< -o $@
clean:
@echo -e "${LOGO}"
@echo -e "${YELLOW} 🧹 Cleaning up..."
@echo -e ""
rm -rf $(OBJ_DIR)/*.o LogInsight
rm *.plist
rm -rf $(OBJ_DIR)
run: all
./LogInsight --help
install:
@echo -e "${LOGO}"
@echo -e "${YELLOW}"
@echo -e " 🗲 Installing LogInsight..."
@sudo cp LogInsight /usr/bin/
@echo -e "${GREEN}"
@echo -e " 🔥 You can run the program with the command:"
@echo -e " LogInsight"
uninstall:
@echo -e "${LOGO}"
@echo -e "${YELLOW}"
@echo -e " 🗲 Uninstalling LogInsight..."
@sudo rm /usr/bin/LogInsight
@echo -e "${GREEN} 🔥 Done!"
help:
@echo -e "${LOGO}"
@echo -e "${YELLOW}🛠️ Usage:"
@echo -e " make Build the project"
@echo -e " make run Build and run the project"
@echo -e " make clean Remove object files and the executable"
@echo -e " make install Install app"
@echo -e " make uninstall Uninstall app"
@echo -e " make help Show this help message${RESET}"
format:
@bash formatting.sh
test:
@bash test.sh
.PHONY: all clean run help