aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2022-04-04 18:09:53 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2022-04-04 18:09:53 +0200
commit4f77685d24fdc3b49a6459b77dc2a23a68aaf30d (patch)
treecc0010e65d51c1b104cce6237a4c37a6f8e2bc6f /Makefile
parentUpdate (diff)
downloadgo2work-4f77685d24fdc3b49a6459b77dc2a23a68aaf30d.tar.gz
go2work-4f77685d24fdc3b49a6459b77dc2a23a68aaf30d.tar.bz2
go2work-4f77685d24fdc3b49a6459b77dc2a23a68aaf30d.tar.xz
go2work-4f77685d24fdc3b49a6459b77dc2a23a68aaf30d.tar.zst
go2work-4f77685d24fdc3b49a6459b77dc2a23a68aaf30d.zip
v1.0.0 incoming
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 41 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 68ae630..3ff7fd0 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@
# ========================
#
# go2work: Makefile
-# Mon Apr 4 17:06:10 CEST 2022
+# Mon Apr 4 18:03:35 CEST 2022
# Joe
#
# GNU Makefile
@@ -19,40 +19,67 @@
default: build
SHELL := /bin/sh
-OS = $(shell uname)
+OS := $(shell uname)
-SRCS_DIR = src/
-DATA_DIR = share/
-TRGT_DIR = ./
+DESTDIR := /usr/local/
+SRCS_DIR := src/
+DATA_DIR := share/
+MAN_DIR := man/
-SRCS_NAME = c_defs
+SRCS_NAME := c_defs
SRCS_NAME += c_go2work
+SRCS_NAME += c_loop
SRCS_NAME += c_player
SRCS_NAME += p_options
SRCS_NAME += u_checks
SRCS_NAME += u_prints
SRCS_NAME += u_utils
-SRCS = $(addprefix ${SRCS_DIR}, $(addsuffix .go, ${SRCS_NAME}))
+SRCS := $(addprefix ${SRCS_DIR}, $(addsuffix .go, ${SRCS_NAME}))
-TRGT_NAME = go2work
-TARGET = $(addprefix ${TRGT_DIR}, ${TRGT_NAME})
+TARGET := go2work
+MAN := $(addsuffix .1, ${TARGET})
-MKDIR = mkdir -p
-RMDIR = rmdir
-RM = rm -rf
+MKDIR := mkdir -p
+RMDIR := rmdir
+RM := rm -rf
+GZIP := gzip
+GUNZIP := gunzip
+INSTALL := install
deps:
go get github.com/BurntSushi/toml@latest
-build: deps
+build: ${TARGET}
+
+${TARGET}: deps
go build -o ${TARGET} ${SRCS}
+install-bin: ${TARGET}
+ ${MKDIR} ${DESTDIR}bin
+ ${INSTALL} -m0555 ${TARGET} ${DESTDIR}bin/${TARGET}
+
+install-data:
+ ${MKDIR} ${DESTDIR}share/${TARGET}
+ ${INSTALL} -m0644 ${DATA_DIR}ring01.wav ${DESTDIR}share/${TARGET}/ring01.wav
+ ${INSTALL} -m0644 ${DATA_DIR}ring02.wav ${DESTDIR}share/${TARGET}/ring02.wav
+
+install-doc:
+ ${MKDIR} ${DESTDIR}man/man1
+ ${GZIP} ${MAN_DIR}${MAN}
+ ${INSTALL} -m0444 ${MAN_DIR}${MAN}.gz ${DESTDIR}man/man1/${MAN}.gz
+ ${GUNZIP} ${MAN_DIR}${MAN}
+
+install: install-bin install-doc
+ false
+
+# ifeq(${OS} == "FreeBSD")
+
clean:
go clean
${RM} ${TARGET}
-.PHONY: build clean deps
+.PHONY: deps build install clean
# File prefixes info
# ------------------