Merge pull request #11 from hasufell/master

Makefile
reverse-branch
Martin Duquesnoy 13 years ago
commit dfb623ab61
  1. 23
      Makefile

@ -3,31 +3,34 @@
#See clock.c for the license detail. #See clock.c for the license detail.
SRC = ttyclock.c SRC = ttyclock.c
CC = cc CC ?= gcc
BIN = tty-clock BIN = tty-clock
INSTALLPATH = /usr/local/bin/ INSTALLPATH = /usr/local/bin/
CFLAGS = -Wall -g CFLAGS ?= -O2 -g
LDFLAGS = -lncurses CFLAGS += -Wall $(shell pkg-config --cflags ncurses 2>/dev/null)
LIBS = $(shell pkg-config --libs ncurses 2>/dev/null | echo -lncurses)
tty-clock : ${SRC} tty-clock : ${SRC}
@echo "build ${SRC}" @echo "build ${SRC}"
@echo "CC ${CFLAGS} ${LDFLAGS} ${SRC}" ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${SRC} -o ${BIN} ${LIBS}
@${CC} ${CFLAGS} ${LDFLAGS} ${SRC} -o ${BIN}
install : ${BIN} install : ${BIN}
@echo "installing binary file to ${INSTALLPATH}${BIN}" @echo "creating target folder in ${DESTDIR}${INSTALLPATH}"
@cp ${BIN} ${INSTALLPATH} @mkdir -p "${DESTDIR}${INSTALLPATH}"
@chmod 755 ${INSTALLPATH}${BIN} @echo "installing binary file to ${DESTDIR}${INSTALLPATH}${BIN}"
@cp ${BIN} "${DESTDIR}${INSTALLPATH}"
@chmod 755 "${DESTDIR}${INSTALLPATH}${BIN}"
@echo "installed" @echo "installed"
uninstall : uninstall :
@echo "uninstalling binary file (${INSTALLPATH}${BIN})" @echo "uninstalling binary file (${DESTDIR}${INSTALLPATH}${BIN})"
@rm -f ${INSTALLPATH}${BIN} @rm -f "${DESTDIR}${INSTALLPATH}${BIN}"
@echo "${BIN} uninstalled" @echo "${BIN} uninstalled"
clean : clean :
@echo "cleaning ${BIN}" @echo "cleaning ${BIN}"

Loading…
Cancel
Save