-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (47 loc) · 1.66 KB
/
Makefile
File metadata and controls
56 lines (47 loc) · 1.66 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
54
55
56
VERSION := 0.1.0
BUILD_TIME := $(shell date +%FT%T%z)
LDFLAGS := -ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)"
BIN := webui
# Define installation directories with configurable prefix
PREFIX ?= /usr
BINDIR := $(PREFIX)/bin
SHAREDIR := $(PREFIX)/share/$(BIN)
build:
go build -C src/ $(LDFLAGS) -o $(BIN)
clean:
rm -f $(BIN)
distclean: clean
rm -f templates/*~ *~
run:
go run src/*.go -d -a . -s /tmp
install: build
install -d $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(SHAREDIR)/assets
install -d $(DESTDIR)$(SHAREDIR)/templates
install -m 755 src/$(BIN) $(DESTDIR)$(BINDIR)/
cp -r assets/* $(DESTDIR)$(SHAREDIR)/assets/
cp -r templates/* $(DESTDIR)$(SHAREDIR)/templates/
@echo "Installation complete."
@echo "The application is now available at $(BINDIR)/$(BIN)"
@echo "All static files have been installed in $(SHAREDIR)/"
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(BIN)
rm -rf $(DESTDIR)$(SHAREDIR)
@echo "Uninstallation complete."
help:
@echo "Infix Web GUI Makefile"
@echo ""
@echo "Targets:"
@echo " build - Build the application"
@echo " run - Run application in debug mode"
@echo " clean - Remove build artifacts"
@echo " distclean - Remove build artifacts and backup files"
@echo " install - Install application"
@echo " uninstall - Uninstall application"
@echo " help - Display this help message"
@echo ""
@echo "Variables:"
@echo " PREFIX - Installation prefix (default: $(PREFIX))"
@echo " DESTDIR - Destination directory for staged installs"
@echo " Example: make DESTDIR=/tmp/stage install"
.PHONY: build run clean distclean install uninstall help