2017-01-26 22:15:14 -05:00
|
|
|
#
|
|
|
|
# Polybar development tasks
|
|
|
|
#
|
|
|
|
BUILDDIR ?= build
|
2017-02-21 02:15:13 -05:00
|
|
|
GENERATOR ?= $(shell for c in ninja make; do command -vp $$c; done | xargs basename | sed "s/ninja/Ninja/;s/make/Unix Makefiles/")
|
2017-01-26 22:15:14 -05:00
|
|
|
|
|
|
|
all: configure build link
|
|
|
|
|
2017-11-30 15:42:11 -05:00
|
|
|
help:
|
|
|
|
@echo "Available targets:"
|
|
|
|
@awk -F':' '/^\w*:/ {print " "$$1;}' Makefile
|
|
|
|
|
2017-01-26 22:15:14 -05:00
|
|
|
configure:
|
|
|
|
@echo "\033[32;1m**\033[0m Configuring..."
|
|
|
|
@mkdir -p $(BUILDDIR)
|
|
|
|
@cd $(BUILDDIR) && cmake -G "$(GENERATOR)" ..
|
|
|
|
|
|
|
|
build:
|
|
|
|
@echo "\033[32;1m**\033[0m Building..."
|
|
|
|
@cmake --build $(BUILDDIR)
|
|
|
|
|
|
|
|
install:
|
|
|
|
@echo "\033[32;1m**\033[0m Installing..."
|
|
|
|
@cmake --build $(BUILDDIR) --target install
|
|
|
|
|
|
|
|
link:
|
|
|
|
@echo "\033[32;1m**\033[0m Linking executable..."
|
|
|
|
@if [ -x $(BUILDDIR)/bin/polybar ]; then ln -sfv $(BUILDDIR)/bin/polybar; fi
|
|
|
|
@if [ -x $(BUILDDIR)/bin/polybar-msg ]; then ln -sfv $(BUILDDIR)/bin/polybar-msg; fi
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "\033[32;1m**\033[0m Cleaning up..."
|
|
|
|
@if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi
|
|
|
|
@if [ -L polybar ]; then rm -v polybar; fi
|
|
|
|
@if [ -L polybar-msg ]; then rm -v polybar-msg; fi
|
|
|
|
|
2017-11-30 15:42:11 -05:00
|
|
|
.PHONY: configure build link clean help
|
2017-01-26 22:15:14 -05:00
|
|
|
|
|
|
|
# vim:ts=2 sw=2 noet nolist
|