1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-18 21:55:45 +02:00
bees/Makefile
Zygo Blaxell 9d295fab4e Makefile: if multiple Markdown utilities are present, use the first one
If two utilities are found, we get commands like

	/usr/bin/markdown /usr/bin/markdown_py README.md > README.html

and that doesn't work.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
2018-01-07 20:23:20 -05:00

53 lines
1.4 KiB
Makefile

PREFIX ?= /
LIBEXEC_PREFIX ?= $(PREFIX)/usr/lib/bees
MARKDOWN := $(firstword $(shell which markdown markdown2 markdown_py 2>/dev/null))
MARKDOWN ?= markdown
# allow local configuration to override above variables
-include localconf
default all: lib src test README.html
clean: ## Cleanup
git clean -dfx
.PHONY: lib src test
lib: ## Build libs
$(MAKE) -C lib
src: ## Build bins
src: lib
$(MAKE) -C src
test: ## Run tests
test: lib src
$(MAKE) -C test
scripts/beesd: scripts/beesd.in
sed -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#' -e's#@PREFIX@#$(PREFIX)#' "$<" >"$@"
scripts/beesd@.service: scripts/beesd@.service.in
sed -e's#@LIBEXEC_PREFIX@#$(LIBEXEC_PREFIX)#' -e's#@PREFIX@#$(PREFIX)#' "$<" >"$@"
scripts: scripts/beesd scripts/beesd@.service
README.html: README.md
$(MARKDOWN) README.md > README.html.new
mv -f README.html.new README.html
install: ## Install bees + libs
install: lib src test
install -Dm644 lib/libcrucible.so $(PREFIX)/usr/lib/libcrucible.so
install -Dm755 bin/bees $(LIBEXEC_PREFIX)/bees
install_scripts: ## Install scipts
install_scripts:
install -Dm755 scripts/beesd $(PREFIX)/usr/sbin/beesd
install -Dm644 scripts/beesd.conf.sample $(PREFIX)/etc/bees/beesd.conf.sample
install -Dm644 scripts/beesd@.service $(PREFIX)/lib/systemd/system/beesd@.service
help: ## Show help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\t/'