-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 907 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (29 loc) · 907 Bytes
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
# Directory variables
SRC_DIR = src
INSTALL_DIR = /usr/local/sbin
# List of scripts to install (dynamically get all files in the src directory)
SCRIPTS = $(wildcard $(SRC_DIR)/*)
# Default target
all:
@echo "Default make does not perform installation. Use 'make install' to install scripts."
# Install target
install:
@echo "Installing scripts to $(INSTALL_DIR)..."
@for script in $(SCRIPTS); do \
script_name=$$(basename $$script); \
echo "Installing $$script_name..."; \
install -m 755 $$script $(INSTALL_DIR)/$$script_name; \
done
# Uninstall target
uninstall:
@echo "Removing scripts from $(INSTALL_DIR)..."
@for script in $(SCRIPTS); do \
script_name=$$(basename $$script); \
echo "Removing $$script_name..."; \
rm -f $(INSTALL_DIR)/$$script_name; \
done
# Clean target
clean:
@echo "Clean target does nothing for now..."
# Phony targets
.PHONY: all install uninstall clean