-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 699 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (26 loc) · 699 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
PREFIX ?= /usr/local
INSTALL_DIR = $(PREFIX)/bin
BUILD_DIR = .build/release
.PHONY: build install uninstall clean test
build:
swift build -c release --disable-sandbox
install: build
@if [ -w "$(INSTALL_DIR)" ]; then \
mkdir -p $(INSTALL_DIR); \
cp $(BUILD_DIR)/viewglass $(INSTALL_DIR)/viewglass; \
else \
sudo mkdir -p $(INSTALL_DIR); \
sudo cp $(BUILD_DIR)/viewglass $(INSTALL_DIR)/viewglass; \
fi
@echo "Installed viewglass to $(INSTALL_DIR)/viewglass"
uninstall:
@if [ -w "$(INSTALL_DIR)/viewglass" ]; then \
rm -f $(INSTALL_DIR)/viewglass; \
else \
sudo rm -f $(INSTALL_DIR)/viewglass; \
fi
@echo "Uninstalled viewglass"
clean:
swift package clean
test:
swift test