sic/Makefile

60 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

.POSIX:
2006-07-17 20:17:31 +04:00
NAME = sic
VERSION = 1.3
2006-07-17 20:17:31 +04:00
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
# use system flags.
SIC_CFLAGS = ${CFLAGS}
SIC_LDFLAGS = ${LDFLAGS}
SIC_CPPFLAGS = ${LDFLAGS} -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
BIN = sic
SRC = ${BIN:=.c}
2006-07-17 20:17:31 +04:00
OBJ = ${SRC:.c=.o}
MAN1 = ${BIN:=.1}
2006-07-17 20:17:31 +04:00
all: ${BIN}
2006-07-17 20:17:31 +04:00
${BIN}: ${@:=.o}
2006-07-17 20:17:31 +04:00
${OBJ}: config.h strlcpy.c util.c
2006-07-17 20:17:31 +04:00
.o:
${CC} -o $@ $< ${SIC_LDFLAGS}
2014-11-02 11:23:48 +03:00
.c.o:
${CC} -c ${SIC_CFLAGS} ${SIC_CPPFLAGS} -o $@ -c $<
2006-09-26 16:24:26 +04:00
config.h:
cp config.def.h $@
2006-09-26 16:24:26 +04:00
2006-07-17 20:17:31 +04:00
clean:
rm -f ${BIN} ${OBJ} "${NAME}-${VERSION}.tar.gz"
2006-07-17 20:17:31 +04:00
dist:
mkdir -p "${NAME}-${VERSION}"
cp -fR LICENSE Makefile README arg.h config.def.h \
${MAN1} ${SRC} util.c strlcpy.c "${NAME}-${VERSION}"
tar -cf - "${NAME}-${VERSION}" | \
gzip -c > "${NAME}-${VERSION}.tar.gz"
rm -rf "${NAME}-${VERSION}"
2006-07-17 20:17:31 +04:00
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f ${BIN} "${DESTDIR}${PREFIX}/bin"
chmod 755 "${DESTDIR}${PREFIX}/bin/${BIN}"
mkdir -p "${DESTDIR}${MANPREFIX}/man1"
sed "s/VERSION/${VERSION}/g" < ${MAN1} > "${DESTDIR}${MANPREFIX}/man1/${MAN1}"
chmod 644 "${DESTDIR}${MANPREFIX}/man1/${MAN1}"
2006-07-17 20:17:31 +04:00
uninstall:
rm -f \
"${DESTDIR}${PREFIX}/bin/${BIN}"\
"${DESTDIR}${MANPREFIX}/man1/${MAN1}"
2006-09-26 16:24:26 +04:00
.PHONY: all clean dist install uninstall