generated from krisnova/rust-nova
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
44 lines (37 loc) · 2.18 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
###############################################################################
# #
# ███╗ ██╗ ██████╗ ██╗ ██╗ █████╗ #
# ████╗ ██║██╔═══██╗██║ ██║██╔══██╗ #
# ██╔██╗ ██║██║ ██║██║ ██║███████║ #
# ██║╚██╗██║██║ ██║╚██╗ ██╔╝██╔══██║ #
# ██║ ╚████║╚██████╔╝ ╚████╔╝ ██║ ██║ #
# ╚═╝ ╚═══╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ #
# Written By: Kris Nóva <admin@krisnova.net> #
# #
###############################################################################
CC ?= clang
TARGET ?= tcpjack
DESTDIR ?= /usr/bin
CFLAGS ?= -I/usr/include -I./include -L/usr/lib -g -O0
LDFLAGS ?=
LIBS ?= -lnet -lpcap
STYLE ?= Google
SOURCES ?= src/tcpjack.c src/list.c src/proc.c src/trace.c src/packet.c
default: tcpjack
all: tcpjack install
.PHONY: tcpjack
tcpjack: ## Compile for the local architecture ⚙
@$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $(TARGET) $(SOURCES)
install: ## Install the program to /usr/bin 🎉
@echo "Installing..."
install -m 755 $(TARGET) $(DESTDIR)/$(TARGET)
clean: ## Clean your artifacts 🧼
@echo "Cleaning..."
@rm -rvf $(TARGET)
format: ## Format the code
@echo " -> Formatting code"
@clang-format -i -style=$(STYLE) ./src/*.c
@clang-format -i -style=$(STYLE) ./include/*.h
.PHONY: help
help: ## 🤔 Show help messages for make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'