-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
38 lines (30 loc) · 966 Bytes
/
Makefile
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
.DEFAULT_GOAL := stub
bindir ?= ./build/bin
logdir ?= ./build/var/log
uname := $(shell uname -s)
clean: | uninstall
install: | stub
@rsync -a src/ ${bindir}/
ifeq (${uname}, Darwin)
@$(eval _bindir := $(shell greadlink -f ${bindir}))
@$(eval _logdir := $(shell greadlink -f ${logdir}))
@sed -i '' "s|bindir=|bindir=${_bindir}|g" ${bindir}/somafm
@sed -i '' "s|logdir=|logdir=${_logdir}|g" ${bindir}/somafm
else ifeq (${uname}, Linux)
@$(eval _bindir := $(shell readlink -f ${bindir}))
@$(eval _logdir := $(shell readlink -f ${logdir}))
@sed -i "s|bindir=|bindir=${_bindir}|g" ${bindir}/somafm
@sed -i "s|logdir=|logdir=${_logdir}|g" ${bindir}/somafm
endif
stub:
@mkdir -p ${bindir}
@mkdir -p ${logdir}
test: | test-unit test-integration
test-integration: | install
@bats test/integration
test-unit: | install
@bats test/unit
uninstall:
@rm -rf ${bindir}
@rm -rf ${logdir}
.PHONY: clean install stub test test-integration test-unit uninstall