From efb214f552afc854a9eacdaea4ce17bc9d5c0a43 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Sun, 24 May 2020 13:56:52 +0200 Subject: Convert Makefile --- Makefile | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f4b7025..95cd170 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,30 @@ -# $OpenBSD: Makefile,v 1.2 2014/12/05 20:02:41 florian Exp $ - -PROG= slowcgi -SRCS= slowcgi.c -CFLAGS+= -Wall -CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -CFLAGS+= -Wmissing-declarations -CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual -CFLAGS+= -Wsign-compare -LDADD= -levent -DPADD= ${LIBEVENT} -MAN= slowcgi.8 -.include +PROG = slowcgi +OBJS = slowcgi.o getdtablecount.o strlcpy.o +LIBS = libevent + +PREFIX ?= /usr/local +BINDIR ?= ${PREFIX}/bin +MANDIR ?= ${PREFIX}/share/man + +CFLAGS ?= -O2 -pipe +CFLAGS += -MMD -Wall -Wextra -Wno-unused-parameter +CFLAGS += -Wmissing-declarations +CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual +CFLAGS += -Wsign-compare +CFLAGS += -Werror-implicit-function-declaration +CPPFLAGS += -D_GNU_SOURCE $(shell pkg-config --cflags ${LIBS}) +LDLIBS += $(shell pkg-config --libs ${LIBS}) + +${PROG}: ${OBJS} + ${CC} -o $@ ${CFLAGS} ${OBJS} ${LDLIBS} + +install: + install -D -m 0755 -t '${DESTDIR}${BINDIR}' ${PROG} + install -D -m 0644 -t '${DESTDIR}${MANDIR}/man8' ${PROG}.8 + +clean: + rm -f ${OBJS} ${OBJS:.o=.d} ${PROG} + +.PHONY: clean install + +-include ${OBJS:.o=.d} -- cgit v1.2.3-2-gb3c3