svkbd

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/svkbd
Log | Files | Refs | README | LICENSE

Makefile (2054B)


      1 # svkbd - simple virtual keyboard
      2 # See LICENSE file for copyright and license details.
      3 .POSIX:
      4 
      5 NAME = svkbd
      6 VERSION = 0.3
      7 
      8 include config.mk
      9 
     10 BIN = ${NAME}-${LAYOUT}
     11 SRC = drw.c ${NAME}.c util.c swc-protocol.c input-method-protocol.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 swc-protocol.c: $(SWCPROTO)
     33 	@echo GEN $@
     34 	wayland-scanner code < $< > $@
     35 
     36 swc-client-protocol.h: $(SWCPROTO)
     37 	@echo GEN $@
     38 	wayland-scanner client-header < $< > $@
     39 
     40 input-method-protocol.c: $(IMPROTO)
     41 	@echo GEN $@
     42 	wayland-scanner code < $< > $@
     43 
     44 input-method-client-protocol.h: $(IMPROTO)
     45 	@echo GEN $@
     46 	wayland-scanner client-header < $< > $@
     47 
     48 text-input-client-protocol.h: $(TIPROTO)
     49 	@echo GEN $@
     50 	wayland-scanner client-header < $< > $@
     51 
     52 ${OBJ}: config.h config.mk swc-client-protocol.h input-method-client-protocol.h text-input-client-protocol.h
     53 
     54 ${BIN}: ${OBJ}
     55 	${CC} -o ${BIN} ${OBJ} ${SVKBD_LDFLAGS}
     56 
     57 clean:
     58 	rm -f ${NAME}-?? ${NAME}-??.o ${OBJ} ${BIN}
     59 
     60 dist:
     61 	rm -rf "${NAME}-${VERSION}"
     62 	mkdir -p "${NAME}-${VERSION}"
     63 	cp LICENSE Makefile README.md config.def.h config.mk ${MAN1} \
     64 		drw.h util.h ${SRC} ${NAME}-${VERSION}
     65 	for i in layout.*.h; \
     66 	do \
     67 		cp $$i ${NAME}-${VERSION}; \
     68 	done
     69 	tar -cf - "${NAME}-${VERSION}" | \
     70 		gzip -c > "${NAME}-${VERSION}.tar.gz"
     71 	rm -rf "${NAME}-${VERSION}"
     72 
     73 install: all
     74 	mkdir -p ${DESTDIR}${PREFIX}/bin
     75 	cp -f ${NAME}-${LAYOUT} ${DESTDIR}${PREFIX}/bin
     76 	chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}-${LAYOUT}
     77 	mkdir -p "${DESTDIR}${MANPREFIX}/man1"
     78 	sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     79 	chmod 644 ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     80 
     81 uninstall:
     82 	rm -f ${DESTDIR}${PREFIX}/bin/${NAME}-??
     83 	rm -f ${DESTDIR}${MANPREFIX}/man1/${MAN1}
     84 
     85 .PHONY: all clean dist options install uninstall