Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
55 lines (40 sloc) 1.37 kb
#TTY-Clock MakeFile
#Under BSD License
#See clock.c for the license detail.
SRC = ttyclock.c
CC ?= gcc
BIN = tty-clock
PREFIX ?= /usr/local
INSTALLPATH = ${DESTDIR}${PREFIX}/bin
MANPATH = ${DESTDIR}${PREFIX}/share/man/man1
ifeq ($(shell sh -c 'which ncurses5-config>/dev/null 2>/dev/null && echo y'), y)
CFLAGS = -Wall -g -I $$(ncurses5-config --includedir)
LDFLAGS = -L $$(ncurses5-config --libdir) $$(ncursesw5-config --libs)
else ifeq ($(shell sh -c 'which ncursesw5-config>/dev/null 2>/dev/null && echo y'), y)
CFLAGS = -Wall -g -I $$(ncursesw5-config --includedir)
LDFLAGS = -L $$(ncursesw5-config --libdir) $$(ncursesw5-config --libs)
endif
tty-clock : ${SRC}
@echo "build ${SRC}"
@echo "CC ${CFLAGS} ${LDFLAGS} ${SRC}"
@${CC} ${CFLAGS} ${SRC} -o ${BIN} ${LDFLAGS}
install : ${BIN}
@echo "installing binary file to ${INSTALLPATH}/${BIN}"
@mkdir -p ${INSTALLPATH}
@cp ${BIN} ${INSTALLPATH}
@chmod 0755 ${INSTALLPATH}/${BIN}
@echo "installing manpage to ${MANPATH}/${BIN}.1"
@mkdir -p ${MANPATH}
@cp ${BIN}.1 ${MANPATH}
@chmod 0644 ${MANPATH}/${BIN}.1
@echo "installed"
uninstall :
@echo "uninstalling binary file (${INSTALLPATH})"
@rm -f ${INSTALLPATH}/${BIN}
@echo "uninstalling manpage (${MANPATH})"
@rm -f ${MANPATH}/${BIN}.1
@echo "${BIN} uninstalled"
clean :
@echo "cleaning ${BIN}"
@rm -f ${BIN}
@echo "${BIN} cleaned"
Jump to Line
Something went wrong with that request. Please try again.