wm/Makefile

69 lines
2.0 KiB
Makefile

WINDOWSIZE=1280x720
VERCMD ?= git describe --tags 2> /dev/null
VERSION := $(shell $(VERCMD) || cat VERSION)
PREFIX ?= /usr/local
BINPREFIX ?= $(PREFIX)/bin
MANPREFIX ?= $(PREFIX)/share/man
DOCPREFIX ?= $(PREFIX)/share/doc/bspwm
BASHCPL ?= $(PREFIX)/share/bash-completion/completions
FISHCPL ?= $(PREFIX)/share/fish/vendor_completions.d
ZSHCPL ?= $(PREFIX)/share/zsh/site-functions
MD_DOCS = README.md doc/CHANGELOG.md doc/CONTRIBUTING.md doc/INSTALL.md doc/MISC.md doc/TODO.md
XSESSIONS ?= $(PREFIX)/share/xsessions
all: bspwm bspc
VPATH=src
bspwm: cmd/bspwm src/**/*
go build -o tspwm ./cmd/bspwm
bspc: cmd/bspc src/**/*
go build -o tspc ./cmd/bspc
xephyr:
Xephyr :11 -br -ac -noreset -screen ${WINDOWSIZE}
install:
mkdir -p "$(DESTDIR)$(BINPREFIX)"
# cp -pf tspwm "$(DESTDIR)$(BINPREFIX)"
cp -pf tspc "$(DESTDIR)$(BINPREFIX)"
mkdir -p "$(DESTDIR)$(MANPREFIX)"/man1
# cp -p doc/tspwm.1 "$(DESTDIR)$(MANPREFIX)"/man1
cp -Pp doc/tspc.1 "$(DESTDIR)$(MANPREFIX)"/man1
mkdir -p "$(DESTDIR)$(BASHCPL)"
cp -p contrib/bash_completion "$(DESTDIR)$(BASHCPL)"/tspc
mkdir -p "$(DESTDIR)$(FISHCPL)"
cp -p contrib/fish_completion "$(DESTDIR)$(FISHCPL)"/tspc.fish
mkdir -p "$(DESTDIR)$(ZSHCPL)"
cp -p contrib/zsh_completion "$(DESTDIR)$(ZSHCPL)"/_tspc
mkdir -p "$(DESTDIR)$(DOCPREFIX)"
cp -p $(MD_DOCS) "$(DESTDIR)$(DOCPREFIX)"
mkdir -p "$(DESTDIR)$(DOCPREFIX)"/examples
cp -pr examples/* "$(DESTDIR)$(DOCPREFIX)"/examples
mkdir -p "$(DESTDIR)$(XSESSIONS)"
# cp -p contrib/freedesktop/bspwm.desktop "$(DESTDIR)$(XSESSIONS)"
uninstall:
rm -f "$(DESTDIR)$(BINPREFIX)"/tspwm
rm -f "$(DESTDIR)$(BINPREFIX)"/tspc
rm -f "$(DESTDIR)$(MANPREFIX)"/man1/tspwm.1
rm -f "$(DESTDIR)$(MANPREFIX)"/man1/tspc.1
rm -f "$(DESTDIR)$(BASHCPL)"/tspc
rm -f "$(DESTDIR)$(FISHCPL)"/tspc.fish
rm -f "$(DESTDIR)$(ZSHCPL)"/_tspc
rm -rf "$(DESTDIR)$(DOCPREFIX)"
rm -f "$(DESTDIR)$(XSESSIONS)"/tspwm.desktop
doc:
a2x -v -d manpage -f manpage -a revnumber=$(VERSION) doc/tspwm.1.asciidoc
clean:
rm -f $(WM_OBJ) $(CLI_OBJ) tspwm tspc
.PHONY: all install uninstall doc clean