svkbd

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

Makefile (1577B)


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