aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-05-24 13:56:52 +0200
committerWynn Wolf Arbor2020-05-24 14:05:54 +0200
commitefb214f552afc854a9eacdaea4ce17bc9d5c0a43 (patch)
tree61e92b08ec487a3d5f8f1c9cc563a3d362634bff /Makefile
parent687f61eb77d0878d752266ace8bb8933cf5f9556 (diff)
downloadslowcgi-efb214f552afc854a9eacdaea4ce17bc9d5c0a43.tar.gz
Convert Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files 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 <bsd.prog.mk>
+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}