iomenu

interactive terminal dmenu-style menu
Log | Files | Refs | README | LICENSE

Makefile (857B)


      1 NAME = iomenu
      2 VERSION = 0.1
      3 
      4 SRC = utf8.c compat.c wcwidth.c term.c
      5 HDR = utf8.h compat.h wcwidth.h term.h
      6 OBJ = ${SRC:.c=.o}
      7 BIN = iomenu
      8 MAN1 = ${BIN:=.1}
      9 LIB =
     10 
     11 W = -Wall -Wextra -std=c99 --pedantic
     12 I = -I./src
     13 L =
     14 D = -DVERSION='"${VERSION}"'
     15 CFLAGS = $I $D $W -g
     16 LDFLAGS = $L -static
     17 PREFIX = /usr/local
     18 MANPREFIX = ${PREFIX}/man
     19 
     20 all: ${BIN}
     21 
     22 .c.o:
     23 	${CC} -c ${CFLAGS} -o $@ $<
     24 
     25 ${OBJ}: ${HDR}
     26 ${BIN}: ${OBJ} ${BIN:=.o}
     27 	${CC} ${LDFLAGS} -o $@ $@.o ${OBJ} ${LIB}
     28 
     29 clean:
     30 	rm -rf *.o ${BIN} ${NAME}-${VERSION} *.gz
     31 
     32 install:
     33 	mkdir -p ${DESTDIR}${PREFIX}/bin
     34 	cp -rf bin/* ${BIN} ${DESTDIR}${PREFIX}/bin
     35 	mkdir -p ${DESTDIR}${MANPREFIX}/man1
     36 	cp -rf ${MAN1} ${DESTDIR}${MANPREFIX}/man1
     37 
     38 dist: clean
     39 	mkdir -p ${NAME}-${VERSION}
     40 	cp -r README Makefile ${MAN1} ${SRC} ${NAME}-${VERSION}
     41 	tar -cf - ${NAME}-${VERSION} | gzip -c >${NAME}-${VERSION}.tar.gz