~hallyn/svkbd

ref: b25e55e4622d419f252570d15080cdd2628b9236 svkbd/Makefile -rw-r--r-- 1.5 KiB
b25e55e4 — Hiltjo Posthuma bump version to 0.3 1 year, 2 months ago
                                                                                
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# svkbd - simple virtual keyboard
# See LICENSE file for copyright and license details.
.POSIX:

NAME = svkbd
VERSION = 0.3

include config.mk

BIN = ${NAME}-${LAYOUT}
SRC = drw.c ${NAME}.c util.c
OBJ = ${SRC:.c=.o}
MAN1 = ${NAME}.1

all: ${BIN}

options:
	@echo svkbd build options:
	@echo "CFLAGS   = ${SVKBD_CFLAGS}"
	@echo "CPPLAGS  = ${SVKBD_CPPFLAGS}"
	@echo "LDFLAGS  = ${SVKBD_LDFLAGS}"
	@echo "CC       = ${CC}"

config.h:
	cp config.def.h $@

svkbd.o: config.h layout.${LAYOUT}.h

.c.o:
	${CC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} -c $<

${OBJ}: config.h config.mk

${BIN}: ${OBJ}
	${CC} -o ${BIN} ${OBJ} ${SVKBD_LDFLAGS}

clean:
	rm -f ${NAME}-?? ${NAME}-??.o ${OBJ} ${BIN}

dist:
	rm -rf "${NAME}-${VERSION}"
	mkdir -p "${NAME}-${VERSION}"
	cp LICENSE Makefile README.md config.def.h config.mk ${MAN1} \
		drw.h util.h ${SRC} ${NAME}-${VERSION}
	for i in layout.*.h; \
	do \
		cp $$i ${NAME}-${VERSION}; \
	done
	tar -cf - "${NAME}-${VERSION}" | \
		gzip -c > "${NAME}-${VERSION}.tar.gz"
	rm -rf "${NAME}-${VERSION}"

install: all
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f ${NAME}-${LAYOUT} ${DESTDIR}${PREFIX}/bin
	chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}-${LAYOUT}
	mkdir -p "${DESTDIR}${MANPREFIX}/man1"
	sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MANPREFIX}/man1/${MAN1}
	chmod 644 ${DESTDIR}${MANPREFIX}/man1/${MAN1}

uninstall:
	rm -f ${DESTDIR}${PREFIX}/bin/${NAME}-??
	rm -f ${DESTDIR}${MANPREFIX}/man1/${MAN1}

.PHONY: all clean dist options install uninstall