Blame


1 96e3c013 2022-07-04 op # Copyright (c) 2022 Omar Polo <op@omarpolo.com>
2 96e3c013 2022-07-04 op # Copyright (c) 2011, 2013-2022 Ingo Schwarze <schwarze@openbsd.org>
3 96e3c013 2022-07-04 op # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 96e3c013 2022-07-04 op #
5 96e3c013 2022-07-04 op # Permission to use, copy, modify, and distribute this software for any
6 96e3c013 2022-07-04 op # purpose with or without fee is hereby granted, provided that the above
7 96e3c013 2022-07-04 op # copyright notice and this permission notice appear in all copies.
8 96e3c013 2022-07-04 op #
9 96e3c013 2022-07-04 op # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 96e3c013 2022-07-04 op # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 96e3c013 2022-07-04 op # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 96e3c013 2022-07-04 op # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 96e3c013 2022-07-04 op # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 96e3c013 2022-07-04 op # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 96e3c013 2022-07-04 op # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 96e3c013 2022-07-04 op
17 3096da4e 2021-10-07 op # tests to run as a port of the regression suite. Leave empty to run
18 3096da4e 2021-10-07 op # all.
19 3096da4e 2021-10-07 op TESTS=
20 3096da4e 2021-10-07 op
21 5a345722 2023-06-23 op # host to bind to during regress
22 5a345722 2023-06-23 op REGRESS_HOST = localhost
23 5a345722 2023-06-23 op
24 1610f954 2023-06-13 op # -- build-related variables --
25 1610f954 2023-06-13 op
26 1610f954 2023-06-13 op COBJS = ${COMPATS:.c=.o}
27 1610f954 2023-06-13 op
28 86693a33 2023-06-11 op GMID_SRCS = gmid.c config.c crypto.c dirs.c fcgi.c iri.c log.c \
29 86693a33 2023-06-11 op logger.c mime.c proc.c proxy.c puny.c sandbox.c \
30 3db5bc7c 2024-06-17 op server.c utf8.c utils.c y.tab.c proxy-proto.c
31 96e3c013 2022-07-04 op
32 96e3c013 2022-07-04 op GMID_OBJS = ${GMID_SRCS:.c=.o} ${COBJS}
33 96e3c013 2022-07-04 op
34 f5954349 2023-07-25 op GEMEXP_SRCS = ge.c config.c crypto.c dirs.c fcgi.c iri.c log.c mime.c \
35 3db5bc7c 2024-06-17 op proc.c proxy.c puny.c sandbox.c server.c utf8.c utils.c proxy-proto.c
36 0126d91d 2022-09-07 op
37 f5954349 2023-07-25 op GEMEXP_OBJS = ${GEMEXP_SRCS:.c=.o} ${COBJS}
38 0126d91d 2022-09-07 op
39 f9ab77a8 2023-08-23 op GG_SRCS = gg.c iri.c log.c utf8.c
40 96e3c013 2022-07-04 op
41 96e3c013 2022-07-04 op GG_OBJS = ${GG_SRCS:.c=.o} ${COBJS}
42 96e3c013 2022-07-04 op
43 f9ab77a8 2023-08-23 op TITAN_SRCS = titan.c iri.c log.c utf8.c
44 2ff1e2a9 2023-07-22 op TITAN_OBJS = ${TITAN_SRCS:.c=.o} ${COBJS}
45 2ff1e2a9 2023-07-22 op
46 e3dd9e66 2024-01-10 op SRCS = gmid.h iri.h log.h parse.y proc.h \
47 f5954349 2023-07-25 op ${GMID_SRCS} ${GEMEXP_SRCS} ${GG_SRCS} ${TITAN_SRCS}
48 96e3c013 2022-07-04 op
49 96e3c013 2022-07-04 op DISTNAME = gmid-${VERSION}
50 96e3c013 2022-07-04 op
51 1610f954 2023-06-13 op # -- public targets --
52 1610f954 2023-06-13 op
53 f5954349 2023-07-25 op all: config.mk gmid gemexp gg titan
54 24f644db 2023-06-24 op .PHONY: all tags clean cleanall test regress install
55 3e4749f7 2020-10-02 op
56 1610f954 2023-06-13 op config.mk config.h: configure
57 96e3c013 2022-07-04 op @echo "$@ is out of date; please run ./configure"
58 96e3c013 2022-07-04 op @exit 1
59 771d8f28 2021-01-17 op
60 1610f954 2023-06-13 op include config.mk
61 771d8f28 2021-01-17 op
62 3e4749f7 2020-10-02 op clean:
63 f9ab77a8 2023-08-23 op rm -f gmid gemexp gg
64 f9ab77a8 2023-08-23 op rm -f *.[do] compat/*.[do] compat/libtls/*.[do]
65 f9ab77a8 2023-08-23 op rm -f y.tab.c y.tab.h y.output
66 d5f4d615 2021-02-01 op rm -f compile_flags.txt
67 8518014c 2021-07-11 op ${MAKE} -C regress clean
68 33d32d1f 2020-12-25 op
69 96e3c013 2022-07-04 op distclean: clean
70 1610f954 2023-06-13 op rm -f config.h config.h.old config.log config.log.old config.mk
71 96e3c013 2022-07-04 op
72 57d2fca4 2022-03-26 op test: regress
73 e2075518 2022-02-03 op regress: all
74 8e7e7cac 2022-01-02 op ${MAKE} 'TESTS=${TESTS}' -C regress all
75 5c2e310e 2021-01-22 op
76 f5954349 2023-07-25 op install: gmid gg gemexp
77 ac69e83a 2021-01-21 op mkdir -p ${DESTDIR}${BINDIR}
78 ac69e83a 2021-01-21 op mkdir -p ${DESTDIR}${MANDIR}/man1
79 bf2850b9 2022-04-07 op mkdir -p ${DESTDIR}${MANDIR}/man5
80 3eabd37f 2022-09-08 op mkdir -p ${DESTDIR}${MANDIR}/man8
81 f5954349 2023-07-25 op ${INSTALL_PROGRAM} gemexp ${DESTDIR}${BINDIR}
82 e78e2923 2024-01-11 op ${INSTALL_PROGRAM} gg ${DESTDIR}${BINDIR}
83 e78e2923 2024-01-11 op ${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
84 e78e2923 2024-01-11 op ${INSTALL_PROGRAM} titan ${DESTDIR}${BINDIR}
85 f5954349 2023-07-25 op ${INSTALL_MAN} gemexp.1 ${DESTDIR}${MANDIR}/man1
86 135307cf 2022-01-30 op ${INSTALL_MAN} gg.1 ${DESTDIR}${MANDIR}/man1
87 e78e2923 2024-01-11 op ${INSTALL_MAN} titan.1 ${DESTDIR}${MANDIR}/man1
88 e78e2923 2024-01-11 op ${INSTALL_MAN} gmid.conf.5 ${DESTDIR}${MANDIR}/man5
89 e78e2923 2024-01-11 op ${INSTALL_MAN} gmid.8 ${DESTDIR}${MANDIR}/man8
90 d5f4d615 2021-02-01 op
91 96e3c013 2022-07-04 op uninstall:
92 f5954349 2023-07-25 op rm ${DESTDIR}${BINDIR}/gemexp
93 96e3c013 2022-07-04 op rm ${DESTDIR}${BINDIR}/gg
94 96e3c013 2022-07-04 op rm ${DESTDIR}${BINDIR}/gmid
95 e78e2923 2024-01-11 op rm ${DESTDIR}${BINDIR}/titan
96 f5954349 2023-07-25 op rm ${DESTDIR}${MANDIR}/man1/gemexp.1
97 96e3c013 2022-07-04 op rm ${DESTDIR}${MANDIR}/man1/gg.1
98 e78e2923 2024-01-11 op rm ${DESTDIR}${MANDIR}/man1/titan.1
99 96e3c013 2022-07-04 op rm ${DESTDIR}${MANDIR}/man5/gmid.conf.5
100 3eabd37f 2022-09-08 op rm ${DESTDIR}${MANDIR}/man8/gmid.8
101 a3c5f745 2021-02-23 op
102 1610f954 2023-06-13 op tags:
103 1610f954 2023-06-13 op ctags ${SRCS}
104 1610f954 2023-06-13 op
105 1610f954 2023-06-13 op # --internal build targets --
106 1610f954 2023-06-13 op
107 1610f954 2023-06-13 op gmid: ${GMID_OBJS}
108 4db22ea6 2023-10-14 op ${CC} ${GMID_OBJS} -o $@ ${LDFLAGS} ${LIBS}
109 1610f954 2023-06-13 op
110 f5954349 2023-07-25 op gemexp: ${GEMEXP_OBJS}
111 4db22ea6 2023-10-14 op ${CC} ${GEMEXP_OBJS} -o $@ ${LDFLAGS} ${LIBS}
112 1610f954 2023-06-13 op
113 1610f954 2023-06-13 op gg: ${GG_OBJS}
114 4db22ea6 2023-10-14 op ${CC} ${GG_OBJS} -o $@ ${LDFLAGS} ${LIBS}
115 1610f954 2023-06-13 op
116 2ff1e2a9 2023-07-22 op titan: ${TITAN_OBJS}
117 4db22ea6 2023-10-14 op ${CC} ${TITAN_OBJS} -o $@ ${LDFLAGS} ${LIBS}
118 2ff1e2a9 2023-07-22 op
119 1610f954 2023-06-13 op y.tab.c: parse.y
120 1610f954 2023-06-13 op ${YACC} -b y parse.y
121 1610f954 2023-06-13 op
122 a3c5f745 2021-02-23 op # make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
123 a3c5f745 2021-02-23 op .SUFFIXES: .c .o
124 a3c5f745 2021-02-23 op .c.o:
125 a3c5f745 2021-02-23 op ${CC} ${CFLAGS} -c $< -o $@
126 96e3c013 2022-07-04 op
127 4b93be28 2022-10-31 op # -- maintainer targets --
128 4b93be28 2022-10-31 op
129 c3d502d4 2023-06-24 op .PHONY: lint release dist
130 5dad3900 2023-06-14 op
131 c3d502d4 2023-06-24 op lint:
132 4c128857 2023-10-18 op man -Tlint -Wstyle -l gmid.8 gmid.conf.5 gemexp.1 gg.1 titan.1
133 c3d502d4 2023-06-24 op
134 fe37d792 2024-01-24 op PUBKEY = keys/gmid-2.0.pub
135 8d0573e8 2024-01-10 op PRIVKEY = set-PRIVKEY
136 c727f8dd 2023-06-08 op DISTFILES = .cirrus.yml .dockerignore .gitignore ChangeLog LICENSE \
137 ee42fb87 2023-08-23 op Makefile README.md config.c configure crypto.c dirs.c fcgi.c \
138 ee42fb87 2023-08-23 op ge.c gemexp.1 gg.1 gg.c gmid.8 gmid.c gmid.conf.5 gmid.h \
139 e3dd9e66 2024-01-10 op iri.c iri.h log.c log.h logger.c mime.c parse.y proc.c \
140 c46b7a0c 2024-06-17 op proc.h proxy.c proxy-proto.c puny.c sandbox.c server.c \
141 c46b7a0c 2024-06-17 op titan.1 titan.c utf8.c utils.c y.tab.c
142 4b93be28 2022-10-31 op
143 5dad3900 2023-06-14 op release:
144 8d0573e8 2024-01-10 op sed -i -e '/^RELEASE=/s/no/yes/' configure
145 5dad3900 2023-06-14 op ${MAKE} dist
146 8d0573e8 2024-01-10 op sed -i -e '/^RELEASE=/s/yes/no/' configure
147 8d0573e8 2024-01-10 op signify -S -e -m ${DISTNAME}.sha256 -s ${PRIVKEY}
148 5dad3900 2023-06-14 op
149 8d0573e8 2024-01-10 op verify-release:
150 8d0573e8 2024-01-10 op signify -C -p ${PUBKEY} -x ${DISTNAME}.sha256.sig
151 8d0573e8 2024-01-10 op
152 96e3c013 2022-07-04 op dist: ${DISTNAME}.sha256
153 96e3c013 2022-07-04 op
154 96e3c013 2022-07-04 op ${DISTNAME}.sha256: ${DISTNAME}.tar.gz
155 8d0573e8 2024-01-10 op sha256 ${DISTNAME}.tar.gz > $@
156 96e3c013 2022-07-04 op
157 96e3c013 2022-07-04 op ${DISTNAME}.tar.gz: ${DISTFILES}
158 96e3c013 2022-07-04 op mkdir -p .dist/${DISTNAME}/
159 4b93be28 2022-10-31 op ${INSTALL} -m 0644 ${DISTFILES} .dist/${DISTNAME}/
160 96e3c013 2022-07-04 op cd .dist/${DISTNAME} && chmod 755 configure
161 4a2e39c2 2024-06-10 op ${MAKE} -C compat DESTDIR=${PWD}/.dist/${DISTNAME}/compat dist
162 4b93be28 2022-10-31 op ${MAKE} -C contrib DESTDIR=${PWD}/.dist/${DISTNAME}/contrib dist
163 4a2e39c2 2024-06-10 op ${MAKE} -C have DESTDIR=${PWD}/.dist/${DISTNAME}/have dist
164 4a2e39c2 2024-06-10 op ${MAKE} -C keys DESTDIR=${PWD}/.dist/${DISTNAME}/keys dist
165 4b93be28 2022-10-31 op ${MAKE} -C regress DESTDIR=${PWD}/.dist/${DISTNAME}/regress dist
166 96e3c013 2022-07-04 op cd .dist/ && tar zcf ../$@ ${DISTNAME}
167 96e3c013 2022-07-04 op rm -rf .dist/
168 68e38f49 2023-06-08 op
169 68e38f49 2023-06-08 op # -- dependencies --
170 68e38f49 2023-06-08 op
171 68e38f49 2023-06-08 op -include config.d
172 f29d705e 2023-06-23 op -include crypto.d
173 68e38f49 2023-06-08 op -include dirs.d
174 68e38f49 2023-06-08 op -include fcgi.d
175 f29d705e 2023-06-23 op -include ge.d
176 68e38f49 2023-06-08 op -include gg.d
177 68e38f49 2023-06-08 op -include gmid.d
178 68e38f49 2023-06-08 op -include iri.d
179 68e38f49 2023-06-08 op -include log.d
180 68e38f49 2023-06-08 op -include logger.d
181 68e38f49 2023-06-08 op -include mime.d
182 68e38f49 2023-06-08 op -include proc.d
183 68e38f49 2023-06-08 op -include proxy.d
184 c46b7a0c 2024-06-17 op -include proxy-proto.d
185 68e38f49 2023-06-08 op -include puny.d
186 68e38f49 2023-06-08 op -include sandbox.d
187 68e38f49 2023-06-08 op -include server.d
188 e137cb03 2023-07-25 op -include titan.d
189 68e38f49 2023-06-08 op -include utf8.d
190 68e38f49 2023-06-08 op -include utils.d
191 68e38f49 2023-06-08 op -include y.tab.d