2021-05-06 02:39:46 +03:00
|
|
|
.POSIX:
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
NAME = sic
|
|
|
|
VERSION = 1.3
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03: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}
|
2021-05-06 02:39:46 +03:00
|
|
|
MAN1 = ${BIN:=.1}
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
all: ${BIN}
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
${BIN}: ${@:=.o}
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
${OBJ}: config.h strlcpy.c util.c
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
.o:
|
|
|
|
${CC} -o $@ $< ${SIC_LDFLAGS}
|
2014-11-02 11:23:48 +03:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
.c.o:
|
|
|
|
${CC} -c ${SIC_CFLAGS} ${SIC_CPPFLAGS} -o $@ -c $<
|
2006-09-26 16:24:26 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
config.h:
|
|
|
|
cp config.def.h $@
|
2006-09-26 16:24:26 +04:00
|
|
|
|
2006-07-17 20:17:31 +04:00
|
|
|
clean:
|
2021-05-06 02:39:46 +03:00
|
|
|
rm -f ${BIN} ${OBJ} "${NAME}-${VERSION}.tar.gz"
|
2006-07-17 20:17:31 +04:00
|
|
|
|
2021-05-06 02:39:46 +03: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
|
2021-05-06 02:39:46 +03:00
|
|
|
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:
|
2021-05-06 02:39:46 +03:00
|
|
|
rm -f \
|
|
|
|
"${DESTDIR}${PREFIX}/bin/${BIN}"\
|
|
|
|
"${DESTDIR}${MANPREFIX}/man1/${MAN1}"
|
2006-09-26 16:24:26 +04:00
|
|
|
|
2021-05-06 02:39:46 +03:00
|
|
|
.PHONY: all clean dist install uninstall
|