svkbd

simple virtual keyboard
git clone git://git.suckless.org/svkbd
Log | Files | Refs | README | LICENSE

Makefile (1488B)


      1 # svkbd - simple virtual keyboard
      2 # See LICENSE file for copyright and license details.
      3 .POSIX:
      4 
      5 NAME = svkbd
      6 VERSION = 0.4
      7 
      8 include config.mk
      9 
     10 BIN = ${NAME}-${LAYOUT}
     11 SRC = drw.c ${NAME}.c util.c
     12 OBJ = ${SRC:.c=.o}
     13 MAN1 = ${NAME}.1
     14 
     15 all: ${BIN}
     16 
     17 options:
     18 	@echo svkbd build options:
     19 	@echo "CFLAGS   = ${SVKBD_CFLAGS}"
     20 	@echo "CPPLAGS  = ${SVKBD_CPPFLAGS}"
     21 	@echo "LDFLAGS  = ${SVKBD_LDFLAGS}"
     22 	@echo "CC       = ${CC}"
     23 
     24 config.h:
     25 	cp config.def.h $@
     26 
     27 svkbd.o: config.h layout.${LAYOUT}.h
     28 
     29 .c.o:
     30 	${CC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} -c $<
     31 
     32 ${OBJ}: config.h config.mk
     33 
     34 ${BIN}: ${OBJ}
     35 	${CC} -o ${BIN} ${OBJ} ${SVKBD_LDFLAGS}
     36 
     37 clean:
     38 	rm -f ${NAME}-?? ${NAME}-??.o ${OBJ} ${BIN}
     39 
     40 dist:
     41 	rm -rf "${NAME}-${VERSION}"
     42 	mkdir -p "${NAME}-${VERSION}"
     43 	cp LICENSE Makefile README.md config.def.h config.mk ${MAN1} \
     44 		drw.h util.h ${SRC} ${NAME}-${VERSION}
     45 	for i in layout.*.h; \
     46 	do \
     47 		cp $$i ${NAME}-${VERSION}; \
     48 	done
     49 	tar -cf - "${NAME}-${VERSION}" | \
     50 		gzip -c > "${NAME}-${VERSION}.tar.gz"
     51 	rm -rf "${NAME}-${VERSION}"
     52 
     53 install: all
     54 	mkdir -p ${DESTDIR}${PREFIX}/bin
     55 	cp -f ${NAME}-${LAYOUT} ${DESTDIR}${PREFIX}/bin
     56 	chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}-${LAYOUT}
     57 	mkdir -p "${DESTDIR}${MANPREFIX}/man1"
     58 	sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     59 	chmod 644 ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     60 
     61 uninstall:
     62 	rm -f ${DESTDIR}${PREFIX}/bin/${NAME}-??
     63 	rm -f ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     64 
     65 .PHONY: all clean dist options install uninstall