Commit Diff


commit - 21cf735f37d3b5792112e02b58735d69ce18998b
commit + 4b93be289bc141a15484e782c85020b62b878ec2
blob - b8ee92bb6f2f32eef4e56c16307da3105791db6f
blob + b7d3593e83f1b28bd50371684bb6b9a2d9a92d20
--- Makefile
+++ Makefile
@@ -18,50 +18,6 @@
 # all.
 TESTS=
 
-TESTSRCS =	have/err.c \
-		have/explicit_bzero.c \
-		have/freezero.c \
-		have/getdtablecount.c \
-		have/getdtablesize.c \
-		have/getprogname.c \
-		have/imsg.c \
-		have/landlock.c \
-		have/libevent.c \
-		have/libevent2.c \
-		have/libtls.c \
-		have/noop.c \
-		have/openssl.c \
-		have/pr_set_name.c \
-		have/program_invocation_short_name.c \
-		have/queue_h.c \
-		have/reallocarray.c \
-		have/recallocarray.c \
-		have/setproctitle.c \
-		have/strlcat.c \
-		have/strlcpy.c \
-		have/strtonum.c \
-		have/tree_h.c \
-		have/vasprintf.c
-
-COMPATS =	compat/err.c \
-		compat/explicit_bzero.c \
-		compat/freezero.c \
-		compat/getdtablecount.c \
-		compat/getdtablesize.c \
-		compat/getprogname.c \
-		compat/imsg-buffer.c \
-		compat/imsg.c \
-		compat/imsg.h \
-		compat/queue.h \
-		compat/reallocarray.c \
-		compat/recallocarray.c \
-		compat/setproctitle.c \
-		compat/strlcat.c \
-		compat/strlcpy.c \
-		compat/strtonum.c \
-		compat/tree.h \
-		compat/vasprintf.c
-
 GMID_SRCS =	dirs.c \
 		fcgi.c \
 		gmid.c \
@@ -106,63 +62,12 @@ SRCS =		gmid.h \
 		${GE_SRCS} \
 		${GG_SRCS}
 
-REGRESSFILES =	regress/Makefile \
-		regress/env \
-		regress/err \
-		regress/example.mime.types \
-		regress/fcgi-test.c \
-		regress/fill-file.c \
-		regress/hello \
-		regress/invalid \
-		regress/iri_test.c \
-		regress/lib.sh \
-		regress/max-length-reply \
-		regress/puny-test.c \
-		regress/regress \
-		regress/serve-bigfile \
-		regress/sha \
-		regress/slow \
-		regress/tests.sh \
-		regress/valid.ext
-
-EXTRAS =	ChangeLog \
-		LICENSE \
-		Makefile \
-		Makefile.depend \
-		README.md \
-		configure \
-		configure.local.example \
-		ge.1 \
-		gg.1 \
-		gmid.8 \
-		gmid.conf.5
-
-CONTRIB =	contrib/Dockerfile \
-		contrib/gencert \
-		contrib/gmid.service \
-		contrib/gmid.sysusers \
-		contrib/mime.types \
-		contrib/README \
-		contrib/renew-certs \
-		contrib/vim/ftdetect/gmid.vim \
-		contrib/vim/ftplugin/gmid.vim \
-		contrib/vim/indent/gmid.vim \
-		contrib/vim/syntax_checkers/gmid/gmid.vim \
-		contrib/vim/syntax/gmid.vim
-
-DISTFILES =	${EXTRAS} \
-		${CONTRIB} \
-		${COMPATS} \
-		${REGRESSFILES} \
-		${SRCS} \
-		${TESTSRCS}
-
 DISTNAME =	gmid-${VERSION}
 
 all: Makefile.local gmid ge gg
 .PHONY: all static clean cleanall test regress install
 
-Makefile.local config.h: configure ${TESTSRCS}
+Makefile.local config.h: configure
 	@echo "$@ is out of date; please run ./configure"
 	@exit 1
 
@@ -225,6 +130,41 @@ uninstall:
 .c.o:
 	${CC} ${CFLAGS} -c $< -o $@
 
+# -- maintainer targets --
+
+DISTFILES =	.cirrus.yml \
+		.dockerignore \
+		.gitignore \
+		ChangeLog \
+		LICENSE \
+		Makefile \
+		Makefile.depend \
+		README.md \
+		configure \
+		configure.local.example \
+		dirs.c \
+		fcgi.c \
+		ge.1 \
+		ge.c \
+		gg.1 \
+		gg.c \
+		gmid.8 \
+		gmid.c \
+		gmid.conf.5 \
+		gmid.h \
+		iri.c \
+		landlock_shim.h \
+		log.c \
+		mime.c \
+		parse.y \
+		proxy.c \
+		puny.c \
+		sandbox.c \
+		server.c \
+		utf8.c \
+		utils.c \
+		y.tab.c
+
 depend: config.h y.tab.c
 	mkdep -f Makefile.tmp1 ${CFLAGS} ${GE_SRCS} ${GG_SRCS} ${GMID_SRCS} \
 		${COBJSx:.o=.c}
@@ -240,18 +180,11 @@ ${DISTNAME}.sha256: ${DISTNAME}.tar.gz
 
 ${DISTNAME}.tar.gz: ${DISTFILES}
 	mkdir -p .dist/${DISTNAME}/
-	${INSTALL} -m 0644 ${SRCS} ${EXTRAS} .dist/${DISTNAME}
+	${INSTALL} -m 0644 ${DISTFILES} .dist/${DISTNAME}/
 	cd .dist/${DISTNAME} && chmod 755 configure
-	mkdir -p .dist/${DISTNAME}/contrib
-	${INSTALL} -m 0644 ${CONTRIB} .dist/${DISTNAME}/contrib
-	cd .dist/${DISTNAME}/contrib && chmod 755 gencert renew-certs
-	mkdir -p .dist/${DISTNAME}/compat
-	${INSTALL} -m 0644 ${COMPATS} .dist/${DISTNAME}/compat
-	mkdir -p .dist/${DISTNAME}/have
-	${INSTALL} -m 0644 ${TESTSRCS} .dist/${DISTNAME}/have
-	mkdir -p .dist/${DISTNAME}/regress
-	${INSTALL} -m 0644 ${REGRESSFILES} .dist/${DISTNAME}/regress
-	cd .dist/${DISTNAME}/regress && chmod 755 env err hello invalid \
-	    max-length-reply regress sha slow
+	${MAKE} -C compat	DESTDIR=${PWD}/.dist/${DISTNAME}/compat dist
+	${MAKE} -C contrib	DESTDIR=${PWD}/.dist/${DISTNAME}/contrib dist
+	${MAKE} -C have		DESTDIR=${PWD}/.dist/${DISTNAME}/have dist
+	${MAKE} -C regress	DESTDIR=${PWD}/.dist/${DISTNAME}/regress dist
 	cd .dist/ && tar zcf ../$@ ${DISTNAME}
 	rm -rf .dist/
blob - /dev/null
blob + 83f439c9bb69df3d780dc4e0b6defabe22a39671 (mode 644)
--- /dev/null
+++ compat/Makefile
@@ -0,0 +1,29 @@
+DISTFILES =	Makefile \
+		err.c \
+		explicit_bzero.c \
+		freezero.c \
+		getdtablecount.c \
+		getdtablesize.c \
+		getprogname.c \
+		imsg-buffer.c \
+		imsg.c \
+		imsg.h \
+		queue.h \
+		reallocarray.c \
+		recallocarray.c \
+		setproctitle.c \
+		strlcat.c \
+		strlcpy.c \
+		strtonum.c \
+		tree.h \
+		vasprintf.c
+
+all:
+	false
+
+dist: ${DISTFILES}
+	mkdir -p ${DESTDIR}/
+	${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
+
+.PHONY: all dist
+include ../Makefile.local
blob - /dev/null
blob + 9489eea384e2dc9c66f0db9a1ef9ebeeadc65aaa (mode 644)
--- /dev/null
+++ contrib/Makefile
@@ -0,0 +1,20 @@
+DISTFILES =	Makefile \
+		Dockerfile \
+		README \
+		gencert \
+		gmid.service \
+		gmid.sysusers \
+		mime.types \
+		renew-certs
+
+all:
+	false
+
+dist: ${DISTFILES}
+	mkdir -p ${DESTDIR}/
+	${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
+	cd ${DESTDIR} && chmod 755 gencert renew-certs
+	cp -R vim ${DESTDIR}/vim
+
+.PHONY: all dist
+include ../Makefile.local
blob - /dev/null
blob + cdd0fecbd59e32dfa89f32d1d77fa21147c9658b (mode 644)
--- /dev/null
+++ have/Makefile
@@ -0,0 +1,35 @@
+DISTFILES =	Makefile \
+		err.c \
+		explicit_bzero.c \
+		freezero.c \
+		getdtablecount.c \
+		getdtablesize.c \
+		getprogname.c \
+		imsg.c \
+		landlock.c \
+		libevent.c \
+		libevent2.c \
+		libtls.c \
+		noop.c \
+		openssl.c \
+		pr_set_name.c \
+		program_invocation_short_name.c \
+		queue_h.c \
+		reallocarray.c \
+		recallocarray.c \
+		setproctitle.c \
+		strlcat.c \
+		strlcpy.c \
+		strtonum.c \
+		tree_h.c \
+		vasprintf.c
+
+all:
+	false
+
+dist: ${DISTFILES}
+	mkdir -p ${DESTDIR}/
+	${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
+
+.PHONY: all dist
+include ../Makefile.local
blob - 57013bf894d6c9f9102555c682d2c443ec6986e8
blob + 5194636c073c65c81ad66940e04a151c37f7fff4
--- regress/Makefile
+++ regress/Makefile
@@ -2,11 +2,30 @@
 # all.
 TESTS=
 
+DISTFILES =	Makefile \
+		env \
+		err \
+		example.mime.types \
+		fcgi-test.c \
+		fill-file.c \
+		hello \
+		invalid \
+		iri_test.c \
+		lib.sh \
+		max-length-reply \
+		puny-test.c \
+		regress \
+		serve-bigfile \
+		sha \
+		slow \
+		tests.sh \
+		valid.ext
+
 include ../Makefile.local
 
 COMPAT= ${COBJS:%=../%}
 
-.PHONY: all data clean regress
+.PHONY: all data clean dist
 
 all: data puny-test iri_test fcgi-test
 	./regress ${TESTS}
@@ -87,3 +106,9 @@ testdata: fill-file
 	cp hello testdata/dir
 	cp testdata/index.gmi testdata/dir/foo.gmi
 	touch testdata/test.m3u8 testdata/foo.1
+
+dist: ${DISTFILES}
+	mkdir -p ${DESTDIR}/
+	${INSTALL} -m 0644 ${DISTFILES} ${DESTDIR}/
+	cd ${DESTDIR}/ && chmod +x env err hello invalid \
+		max-length-reply regress sha slow