-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (40 loc) · 1.22 KB
/
Makefile
File metadata and controls
49 lines (40 loc) · 1.22 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
45
46
47
48
49
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2
TARGET = signal_handler
SOURCE = signal_handler.c
INSTALL_DIR = /usr/local/bin
BASH_SCRIPT = DaemonManager
.PHONY: all clean install uninstall test
all: $(TARGET)
$(TARGET): $(SOURCE)
$(CC) $(CFLAGS) -o $(TARGET) $(SOURCE)
clean:
rm -f $(TARGET)
rm -f *.o
install: all
@echo "Installing Daemon Manager..."
sudo cp $(TARGET) $(INSTALL_DIR)/
sudo cp $(BASH_SCRIPT) $(INSTALL_DIR)/
sudo chmod +x $(INSTALL_DIR)/$(TARGET)
sudo chmod +x $(INSTALL_DIR)/$(BASH_SCRIPT)
@echo "Installation complete!"
uninstall:
@echo "Uninstalling Daemon Manager..."
sudo rm -f $(INSTALL_DIR)/$(TARGET)
sudo rm -f $(INSTALL_DIR)/$(BASH_SCRIPT)
@echo "Uninstallation complete!"
test: $(TARGET)
@echo "Running basic tests..."
./$(TARGET) --help || true
@echo "Tests complete!"
debug: CFLAGS += -g -DDEBUG
debug: $(TARGET)
help:
@echo "Available targets:"
@echo " all - Build the signal handler (default)"
@echo " clean - Remove built files"
@echo " install - Install Daemon Manager system-wide"
@echo " uninstall - Remove Daemon Manager from system"
@echo " test - Run basic tests"
@echo " debug - Build with debug symbols"
@echo " help - Show this help message"