install, uninstall and version

modified makefile to be abled to install and uninstall, also installing puts
the correct version in the man page.
All credits go to suckless :^)
xkbcommon
Alessandro Mauri 4 years ago
parent c011888c5f
commit 514407015e
  1. 2
      hkd.1
  2. 19
      makefile

@ -1,4 +1,4 @@
.TH HKD 1 "JULY 2020" "Alessandro Mauri" .TH HKD\-VERSION 1 "JULY 2020" "Alessandro Mauri"
.SH NAME .SH NAME
hkd \- simple HotKey Daemon hkd \- simple HotKey Daemon

@ -1,12 +1,25 @@
CC = gcc CC = gcc
CFLAGS = -Wall -Werror -pedantic --std=c99 -O2 CFLAGS = -Wall -Werror -pedantic --std=c99 -O2
VERSION = 0.1
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
hkd: hkd.o hkd: hkd.c
debug: debug:
gcc $(CFLAGS) -g hkd.c -o hkd_debug gcc $(CFLAGS) -g hkd.c -o hkd_debug
hkd.o: hkd.c install: hkd
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f hkd ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/hkd
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < hkd.1 > ${DESTDIR}${MANPREFIX}/man1/hkd.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/hkd.1
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/hkd\
${DESTDIR}${MANPREFIX}/man1/hkd.1
clean: clean:
rm *.o hkd hkd_debug 2> /dev/null rm -f *.o hkd hkd_debug

Loading…
Cancel
Save