-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (44 loc) · 1.69 KB
/
Makefile
File metadata and controls
53 lines (44 loc) · 1.69 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
50
51
52
53
# Makefile for mac-watcher
PREFIX ?= /usr/local
VERSION = 1.0.7
.PHONY: all install uninstall package clean test update-formula
all:
@echo "Available commands:"
@echo " make install - Install mac-watcher locally (without Homebrew)"
@echo " make uninstall - Uninstall mac-watcher"
@echo " make package - Create a distributable package"
@echo " make update-formula - Update formula with correct SHA256 hash"
@echo " make clean - Clean up build artifacts"
@echo " make test - Run tests"
install:
@echo "Installing mac-watcher..."
install -d $(PREFIX)/bin
install -d $(PREFIX)/share/mac-watcher
install -m 755 bin/mac-watcher $(PREFIX)/bin/mac-watcher
install -m 755 share/mac-watcher/config.sh $(PREFIX)/share/mac-watcher/config.sh
install -m 755 share/mac-watcher/monitor.sh $(PREFIX)/share/mac-watcher/monitor.sh
install -m 755 share/mac-watcher/setup.sh $(PREFIX)/share/mac-watcher/setup.sh
@echo "Installation complete. Run 'mac-watcher --help' for usage."
uninstall:
@echo "Uninstalling mac-watcher..."
rm -f $(PREFIX)/bin/mac-watcher
rm -rf $(PREFIX)/share/mac-watcher
@echo "Uninstall complete."
package:
@echo "Creating package for version $(VERSION)..."
mkdir -p dist
tar -czf dist/mac-watcher-$(VERSION).tar.gz bin/ share/ LICENSE README.md Formula/ Makefile
@echo "Package created at dist/mac-watcher-$(VERSION).tar.gz"
update-formula:
@echo "Updating formula with correct SHA256 hash..."
./package.sh
@echo "Formula updated."
clean:
rm -rf dist/
test:
@echo "Running tests..."
bash -n bin/mac-watcher
bash -n share/mac-watcher/config.sh
bash -n share/mac-watcher/monitor.sh
bash -n share/mac-watcher/setup.sh
@echo "Tests passed."