hurl

Gemini/Gopher/HTTP/HTTPS file grabber
git clone git://bvnf.space/hurl.git
Log | Files | Refs | README | LICENSE

Makefile (1072B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
.POSIX:

NAME = hurl
VERSION = 0.7

PREFIX = /usr/local
BINDIR = ${PREFIX}/bin
MANDIR = ${PREFIX}/man/man1

HURL_CFLAGS = ${CFLAGS}
HURL_LDFLAGS = -ltls ${LDFLAGS}
HURL_CPPFLAGS = -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE

SRC = hurl.c
OBJ = ${SRC:.c=.o}

all: ${NAME}

.c.o:
	${CC} ${HURL_CFLAGS} ${HURL_CPPFLAGS} -c $<

${OBJ}:

${NAME}: ${OBJ}
	${CC} -o $@ ${OBJ} ${HURL_LDFLAGS}

clean:
	rm -f ${NAME} ${OBJ} ${NAME}-${VERSION}.tar.gz

install: all
	mkdir -p "${DESTDIR}${BINDIR}"
	cp -f ${NAME} "${DESTDIR}${BINDIR}"
	chmod 755 "${DESTDIR}${BINDIR}/${NAME}"
	mkdir -p "${DESTDIR}${MANDIR}"
	cp -f ${NAME}.1 "${DESTDIR}${MANDIR}"
	chmod 644 "${DESTDIR}${MANDIR}/${NAME}.1"

uninstall:
	rm -f "${DESTDIR}${BINDIR}/${NAME}"
	rm -f "${DESTDIR}${MANDIR}/${NAME}.1"

dist: clean
	rm -rf "${NAME}-${VERSION}"
	mkdir -p ${NAME}-${VERSION}
	cp -R hurl.vt README LICENSE Makefile ${NAME}.1 \
		${NAME}.c arg.h ${NAME}-${VERSION}
	tar cf - ${NAME}-${VERSION} | \
		gzip -c > "${NAME}-${VERSION}.tar.gz"
	rm -rf "${NAME}-${VERSION}"

.PHONY: all clean dist install uninstall