ksgi

Форк
0
/
Makefile 
601 строка · 17.7 Кб
1
.SUFFIXES: .3 .3.html .8 .8.html .dot .svg .xml .html .in.pc .pc
2
.PHONY: regress afl
3

4
include Makefile.configure
5

6
# Uncomment this to disable -static linking.
7
# This is set to -static only for supporting systems.
8
# This is only for the sample program!
9

10
#LDADD_STATIC	 =
11

12
# If running Linux and seccomp is causing issues, cause violators to trap and
13
# output a debug message instead of just failing.  This is disabled by default
14
# so that violations are properly killed instead of providing an escape hatch.
15
#CPPFLAGS	+= -DSANDBOX_SECCOMP_DEBUG
16

17
# You probably don't need to change anything else...
18

19
WWWDIR		 = /var/www/vhosts/kristaps.bsd.lv/htdocs/kcgi
20
DATADIR 	 = $(SHAREDIR)/kcgi
21
TXMLS		 = tutorial0.xml \
22
		   tutorial1.xml \
23
		   tutorial2.xml \
24
		   tutorial3.xml \
25
		   tutorial4.xml \
26
		   tutorial5.xml \
27
		   tutorial6.xml
28
PCS		 = kcgi.pc \
29
		   kcgi-html.pc \
30
		   kcgi-json.pc \
31
		   kcgi-regress.pc \
32
		   kcgi-xml.pc
33
THTMLS		 = tutorial0.html \
34
		   tutorial1.html \
35
		   tutorial2.html \
36
		   tutorial3.html \
37
		   tutorial4.html \
38
		   tutorial5.html \
39
		   tutorial6.html
40
SBLGS		 = archive.html \
41
		   index.html \
42
		   sample.c.html \
43
		   samplepp.cc.html
44
MAN3DIR	 	 = $(MANDIR)/man3
45
MAN8DIR	 	 = $(MANDIR)/man8
46
VMAJOR		!= grep 'define	KCGI_VMAJOR' kcgi.h | cut -f3
47
VMINOR		!= grep 'define	KCGI_VMINOR' kcgi.h | cut -f3
48
VBUILD		!= grep 'define	KCGI_VBUILD' kcgi.h | cut -f3
49
VERSION		:= $(VMAJOR).$(VMINOR).$(VBUILD)
50
LIBVER		 = 1
51
LIBOBJS 	 = auth.o \
52
		   child.o \
53
		   datetime.o \
54
		   fcgi.o \
55
		   httpauth.o \
56
		   kcgi.o \
57
		   logging.o \
58
		   output.o \
59
		   parent.o \
60
		   sandbox.o \
61
		   sandbox-capsicum.o \
62
		   sandbox-darwin.o \
63
		   sandbox-pledge.o \
64
		   sandbox-seccomp-filter.o \
65
		   template.o \
66
		   wrappers.o
67
MAN3S		 = man/kcgi.3 \
68
		   man/kcgihtml.3 \
69
		   man/kcgijson.3 \
70
		   man/kcgiregress.3 \
71
		   man/kcgixml.3 \
72
		   man/kcgi_buf_printf.3 \
73
		   man/kcgi_buf_putc.3 \
74
		   man/kcgi_buf_puts.3 \
75
		   man/kcgi_buf_write.3 \
76
		   man/kcgi_writer_disable.3 \
77
		   man/kcgi_writer_free.3 \
78
		   man/kcgi_writer_get.3 \
79
		   man/kcgi_writer_putc.3 \
80
		   man/kcgi_writer_puts.3 \
81
		   man/kcgi_writer_write.3 \
82
		   man/kcgi_strerror.3 \
83
		   man/khtml_attr.3 \
84
		   man/khtml_close.3 \
85
		   man/khtml_closeelem.3 \
86
		   man/khtml_closeto.3 \
87
		   man/khtml_double.3 \
88
		   man/khtml_elem.3 \
89
		   man/khtml_elemat.3 \
90
		   man/khtml_entity.3 \
91
		   man/khtml_int.3 \
92
		   man/khtml_ncr.3 \
93
		   man/khtml_open.3 \
94
		   man/khtml_printf.3 \
95
		   man/khtml_putc.3 \
96
		   man/khtml_puts.3 \
97
		   man/khtml_write.3 \
98
		   man/khttp_body.3 \
99
		   man/khttp_datetime2epoch.3 \
100
		   man/khttp_epoch2datetime.3 \
101
		   man/khttp_epoch2str.3 \
102
		   man/khttp_epoch2tms.3 \
103
		   man/khttp_fcgi_free.3 \
104
		   man/khttp_fcgi_getfd.3 \
105
		   man/khttp_fcgi_init.3 \
106
		   man/khttp_fcgi_parse.3 \
107
		   man/khttp_fcgi_test.3 \
108
		   man/khttp_free.3 \
109
		   man/khttp_head.3 \
110
		   man/khttp_parse.3 \
111
		   man/khttp_printf.3 \
112
		   man/khttp_putc.3 \
113
		   man/khttp_puts.3 \
114
		   man/khttp_template.3 \
115
		   man/khttp_templatex.3 \
116
		   man/khttp_urlabs.3 \
117
		   man/khttp_urldecode.3 \
118
		   man/khttp_urlencode.3 \
119
		   man/khttp_urlpart.3 \
120
		   man/khttp_write.3 \
121
		   man/khttpbasic_validate.3 \
122
		   man/khttpdigest_validate.3 \
123
		   man/kjson_array_close.3 \
124
		   man/kjson_array_open.3 \
125
		   man/kjson_close.3 \
126
		   man/kjson_obj_close.3 \
127
		   man/kjson_obj_open.3 \
128
		   man/kjson_open.3 \
129
		   man/kjson_putbool.3 \
130
		   man/kjson_putdouble.3 \
131
		   man/kjson_putint.3 \
132
		   man/kjson_putnull.3 \
133
		   man/kjson_putstring.3 \
134
		   man/kjson_string_close.3 \
135
		   man/kjson_string_open.3 \
136
		   man/kjson_string_write.3 \
137
		   man/kmalloc.3 \
138
		   man/kutil_invalidate.3 \
139
		   man/kutil_log.3 \
140
		   man/kutil_openlog.3 \
141
		   man/kvalid_string.3 \
142
		   man/kxml_close.3 \
143
		   man/kxml_open.3 \
144
		   man/kxml_pop.3 \
145
		   man/kxml_popall.3 \
146
		   man/kxml_prologue.3 \
147
		   man/kxml_push.3 \
148
		   man/kxml_pushnull.3 \
149
		   man/kxml_putc.3 \
150
		   man/kxml_puts.3 \
151
		   man/kxml_write.3
152
MAN8S		 = man/kfcgi.8 
153
MANHTMLS	 =
154
.for f in $(MAN3S) $(MAN8S)
155
MANHTMLS	+= ${f}.html
156
HTMLS		+= ${f}.html
157
.endfor
158
MANS		 = $(MAN3S) \
159
		   $(MAN8S)
160
SRCS 		 = auth.c \
161
		   child.c \
162
		   compats.c \
163
     		   extern.h \
164
		   datetime.c \
165
		   fcgi.c \
166
		   httpauth.c \
167
		   logging.c \
168
     		   kcgi.c \
169
     		   kcgihtml.c \
170
		   kcgijson.c \
171
		   kcgiregress.c \
172
		   kcgixml.c \
173
     		   kcgi.h \
174
     		   kcgihtml.h \
175
		   kcgijson.h \
176
		   kcgiregress.h \
177
		   kcgixml.h \
178
		   kfcgi.c \
179
		   output.c \
180
		   parent.c \
181
     		   sample.c \
182
     		   sample-cgi.c \
183
     		   sample-fcgi.c \
184
		   samplepp.cc \
185
     		   sandbox.c \
186
     		   sandbox-capsicum.c \
187
     		   sandbox-darwin.c \
188
     		   sandbox-pledge.c \
189
     		   sandbox-seccomp-filter.c \
190
		   template.c \
191
		   tests.c \
192
     		   wrappers.c \
193
     		   $(MANS)
194
AFL		 = afl/afl-multipart \
195
		   afl/afl-plain \
196
		   afl/afl-template \
197
		   afl/afl-urlencoded
198
REGRESS		 = regress/test-abort-validator \
199
		   regress/test-basic \
200
		   regress/test-basic-curl \
201
		   regress/test-bearer \
202
		   regress/test-bearer-curl \
203
		   regress/test-bearer-empty \
204
		   regress/test-bearer-validate \
205
		   regress/test-bigfile \
206
		   regress/test-buf \
207
		   regress/test-date2epoch \
208
		   regress/test-datetime2epoch \
209
		   regress/test-datetime-deprecated \
210
		   regress/test-debug-read \
211
		   regress/test-debug-read-long \
212
		   regress/test-debug-write \
213
		   regress/test-debug-write-long \
214
		   regress/test-digest \
215
		   regress/test-digest-auth-int \
216
		   regress/test-digest-auth-int-bad \
217
		   regress/test-epoch2datetime \
218
		   regress/test-epoch2str \
219
		   regress/test-epoch2tm \
220
		   regress/test-epoch2tms \
221
		   regress/test-epoch2ustr \
222
		   regress/test-fcgi-abort-validator \
223
		   regress/test-fcgi-bigfile \
224
		   regress/test-fcgi-file-get \
225
		   regress/test-fcgi-header \
226
		   regress/test-fcgi-header-bad \
227
		   regress/test-fcgi-path-check \
228
		   regress/test-fcgi-ping \
229
		   regress/test-fcgi-ping-double \
230
		   regress/test-fcgi-upload \
231
		   regress/test-file-get \
232
		   regress/test-fork \
233
		   regress/test-gzip \
234
		   regress/test-gzip-bigfile \
235
		   regress/test-header \
236
		   regress/test-header-bad \
237
		   regress/test-header-builtin \
238
		   regress/test-html-disabled \
239
		   regress/test-html-noscope \
240
		   regress/test-html-null-strings \
241
		   regress/test-html-simple \
242
		   regress/test-html-void-elems \
243
		   regress/test-httpdate \
244
		   regress/test-invalidate \
245
		   regress/test-json-controlchars \
246
		   regress/test-json-simple \
247
		   regress/test-logging \
248
		   regress/test-logging-errors \
249
		   regress/test-nogzip \
250
		   regress/test-nullqueryval \
251
		   regress/test-path-check \
252
		   regress/test-ping \
253
		   regress/test-ping-double \
254
		   regress/test-post \
255
		   regress/test-returncode \
256
		   regress/test-template \
257
		   regress/test-upload \
258
		   regress/test-urlencode \
259
		   regress/test-urlencode-deprecated \
260
		   regress/test-urldecode \
261
		   regress/test-urldecode-deprecated \
262
		   regress/test-urlabs \
263
		   regress/test-urlpart \
264
		   regress/test-urlpartx \
265
		   regress/test-urlpart-deprecated \
266
		   regress/test-urlpartx-deprecated \
267
		   regress/test-valid-date \
268
		   regress/test-valid-double \
269
		   regress/test-valid-email \
270
		   regress/test-write
271
SVGS		 = figure1.svg \
272
		   figure4.svg \
273
		   extending01-a.svg \
274
		   extending01-b.svg \
275
		   extending01-c.svg \
276
		   extending01-d.svg \
277
		   tutorial6.svg
278
CSSS	         = archive.css \
279
	           index.css \
280
		   tutorial.css
281
LIBS		 = libkcgi.a \
282
		   libkcgihtml.a \
283
		   libkcgijson.a \
284
		   libkcgixml.a \
285
		   libkcgiregress.a
286
SOLIBS		 = libkcgi.so.$(LIBVER) \
287
		   libkcgihtml.so.$(LIBVER) \
288
		   libkcgijson.so.$(LIBVER) \
289
		   libkcgixml.so.$(LIBVER) \
290
		   libkcgiregress.so.$(LIBVER)
291
CURL_LIBS_PKG	 != curl-config --libs 2>/dev/null || echo "-lcurl"
292
CURL_CFLAGS_PKG	 != curl-config --cflags 2>/dev/null || echo ""
293
LIBS_PKG	 != pkg-config --libs zlib 2>/dev/null || echo "-lz"
294
CFLAGS_PKG	 != pkg-config --cflags zlib 2>/dev/null || echo ""
295
# Because the objects will be compiled into a shared library:
296
CFLAGS		+= -fPIC
297
# To avoid exporting internal functions (kcgi.h etc. have default visibility).
298
CFLAGS		+= -fvisibility=hidden
299
VALGRIND_ARGS	 = -q --leak-check=full --leak-resolution=high --show-reachable=yes
300
VALGRIND_ARGS	+= --suppressions=valgrind.suppressions
301

302
REGRESS_LIBS	  = $(CURL_LIBS_PKG) $(LIBS_PKG) $(LDADD_MD5) -lm
303

304
# The -Wno-deprecated is because the regression tests still check
305
# functions that have been since deprecated.
306

307
REGRESS_CFLAGS	  = $(CURL_CFLAGS_PKG) $(CFLAGS_PKG) -Wno-deprecated-declarations
308

309
all: kfcgi $(LIBS) $(SOLIBS) $(PCS)
310

311
afl: $(AFL)
312

313
samples: sample samplepp sample-fcgi sample-cgi
314

315
regress: $(REGRESS)
316
	@for f in $(REGRESS) ; do \
317
		printf "%s" "./$${f}... " ; \
318
		./$$f >/dev/null 2>/dev/null || { echo "fail" ; exit 1 ; } ; \
319
		echo "ok" ; \
320
	done
321

322
valgrind: $(REGRESS)
323
	@tmp=`mktemp` ; \
324
	err=0 ; \
325
	for f in $(REGRESS) ; do \
326
		echo "valgrind $$f... " ; \
327
		valgrind $(VALGRIND_ARGS) --log-fd=3 ./$$f 1>&2 2>/dev/null 3>>$$tmp ; \
328
	done ; \
329
	cat $$tmp ; \
330
	if [ -s $$tmp ] ; then \
331
		err=1 ; \
332
	else \
333
		err=0 ; \
334
	fi ; \
335
	rm -f $$tmp ; \
336
	exit $$err
337

338
installcgi: sample samplepp sample-fcgi sample-cgi
339
	$(INSTALL_PROGRAM) sample $(PREFIX)/sample.cgi
340
	$(INSTALL_PROGRAM) samplepp $(PREFIX)/samplepp.cgi
341
	$(INSTALL_PROGRAM) sample-cgi $(PREFIX)/sample-simple.cgi
342
	$(INSTALL_PROGRAM) sample-fcgi $(PREFIX)/sample-fcgi.cgi
343
	$(INSTALL_DATA) template.xml $(PREFIX)
344

345
install: all
346
	mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
347
	mkdir -p $(DESTDIR)$(INCLUDEDIR)
348
	mkdir -p $(DESTDIR)$(DATADIR)
349
	mkdir -p $(DESTDIR)$(MAN3DIR)
350
	mkdir -p $(DESTDIR)$(MAN8DIR)
351
	mkdir -p $(DESTDIR)$(SBINDIR)
352
	$(INSTALL_LIB) $(LIBS) $(DESTDIR)$(LIBDIR)
353
	$(INSTALL_LIB) $(SOLIBS) $(DESTDIR)$(LIBDIR)
354
	for f in $(SOLIBS) ; do \
355
		( cd $(DESTDIR)$(LIBDIR) && ln -sf $$f `basename $$f .$(LIBVER)` ) ; \
356
	done
357
	$(INSTALL_DATA) kcgi.h kcgihtml.h kcgijson.h kcgixml.h kcgiregress.h $(DESTDIR)$(INCLUDEDIR)
358
	$(INSTALL_DATA) $(PCS) $(DESTDIR)$(LIBDIR)/pkgconfig
359
	$(INSTALL_MAN) $(MAN3S) $(DESTDIR)$(MAN3DIR)
360
	$(INSTALL_MAN) $(MAN8S) $(DESTDIR)$(MAN8DIR)
361
	$(INSTALL_PROGRAM) kfcgi $(DESTDIR)$(SBINDIR)
362
	$(INSTALL_DATA) template.xml sample.c samplepp.cc sample-fcgi.c sample-cgi.c $(DESTDIR)$(DATADIR)
363

364
www: $(SVGS) $(SBLGS) kcgi.tgz kcgi.tgz.sha512 $(HTMLS) $(THTMLS) extending01.html atom.xml
365

366
installwww: www
367
	mkdir -p $(WWWDIR)/snapshots
368
	$(INSTALL_DATA) $(SBLGS) $(CSSS) extending01.html $(THTMLS) $(SVGS) $(HTMLS) atom.xml $(WWWDIR)
369
	$(INSTALL_DATA) sample.c $(WWWDIR)/sample.c.txt
370
	$(INSTALL_DATA) sample-fcgi.c $(WWWDIR)/sample-fcgi.c.txt
371
	$(INSTALL_DATA) kcgi.tgz kcgi.tgz.sha512 $(WWWDIR)/snapshots/
372
	$(INSTALL_DATA) kcgi.tgz $(WWWDIR)/snapshots/kcgi-$(VERSION).tgz
373
	$(INSTALL_DATA) kcgi.tgz.sha512 $(WWWDIR)/snapshots/kcgi-$(VERSION).tgz.sha512
374

375
distcheck: kcgi.tgz.sha512
376
	mandoc -Tlint -Werror $(MANS)
377
	newest=`grep "<h1>" versions.xml | head -1 | sed 's![ 	]*!!g'` ; \
378
	       [ "$$newest" = "<h1>$(VERSION)</h1>" ] || \
379
		{ echo "Version $(VERSION) not newest in versions.xml" 1>&2 ; exit 1 ; }
380
	rm -rf .distcheck
381
	[ "`openssl dgst -sha512 -hex kcgi.tgz`" = "`cat kcgi.tgz.sha512`" ] || \
382
 		{ echo "Checksum does not match." 1>&2 ; exit 1 ; }
383
	mkdir -p .distcheck
384
	( cd .distcheck && tar -zvxpf ../kcgi.tgz )
385
	( cd .distcheck/kcgi-$(VERSION) && ./configure PREFIX=prefix )
386
	( cd .distcheck/kcgi-$(VERSION) && $(MAKE) )
387
	( cd .distcheck/kcgi-$(VERSION) && $(MAKE) regress )
388
	( cd .distcheck/kcgi-$(VERSION) && $(MAKE) install )
389
	rm -rf .distcheck
390

391
clean:
392
	rm -f kcgi.tgz kcgi.tgz.sha512 $(SVGS) $(HTMLS) 
393
	rm -f sample samplepp samplepp.o sample-fcgi sample.o sample-fcgi.o kfcgi kfcgi.o sample-cgi sample-cgi.o
394
	rm -f $(SBLGS) $(THTMLS) extending01.html atom.xml
395
	rm -f $(LIBOBJS) compats.o 
396
	rm -f $(LIBS) *.so *.so.$(LIBVER)
397
	rm -f kcgihtml.o kcgijson.o kcgixml.o kcgiregress.o regress/regress.o
398
	rm -f *.core
399
	rm -f $(REGRESS) $(AFL) regress/*.o
400
	rm -f $(PCS)
401

402
distclean: clean
403
	rm -f config.h config.log Makefile.configure
404

405
# Our compatibility layer used throughout.
406

407
compats.o: config.h
408

409
# The FastCGI manager is pretty standalone.
410

411
kfcgi: kfcgi.o compats.o
412
	$(CC) $(CFLAGS) -o $@ kfcgi.o compats.o $(LDFLAGS) $(LDADD_LIB_SOCKET)
413

414
kfcgi.o: config.h
415

416
# Regression targets.
417
# All regress programs ("REGRESS") build in regress/regress.o.
418
# Furthermore, they all link into libkcgi and libkcgiregress.
419
# Some of them use the JSON library, so pull those in as well.
420
# Of course, all need the config.h and headers.
421

422
$(REGRESS): config.h kcgi.h regress/regress.h
423
$(REGRESS): regress/regress.o 
424
$(REGRESS): libkcgi.a libkcgiregress.a libkcgijson.a libkcgihtml.a
425

426
# -lm required by kcgi-json (on some systems---better safe than sorry)
427

428
.for BIN in $(REGRESS)
429
$(BIN): $(BIN).c
430
	$(CC) $(CFLAGS) $(REGRESS_CFLAGS) -o $@ $(BIN).c regress/regress.o \
431
		libkcgiregress.a libkcgijson.a libkcgihtml.a libkcgi.a \
432
		$(LDFLAGS) $(REGRESS_LIBS)
433
.endfor
434

435
regress/regress.o: regress/regress.h kcgiregress.h config.h
436

437
regress/regress.o: regress/regress.c
438
	$(CC) $(CFLAGS) $(REGRESS_CFLAGS) -c -o $@ $<
439

440
# The AFL programs call directly into libkcgi.a.
441
# So require that and our configuration.
442

443
.for BIN in $(AFL)
444
$(BIN).o: $(BIN).c config.h kcgi.h extern.h
445
	$(CC) $(CFLAGS) -c -o $@ $(BIN).c
446
$(BIN): $(BIN).o libkcgi.a
447
	$(CC) $(CFLAGS) $(CFLAGS_PKG) -o $@ $(BIN).o libkcgi.a $(LIBS_PKG) $(LDADD_MD5)
448
.endfor
449

450
# The main kcgi library.
451
# Pulls in all objects along with the compatibility layer.
452

453
libkcgi.a: $(LIBOBJS) compats.o
454
	$(AR) rs $@ $(LIBOBJS) compats.o
455

456
libkcgi.so.$(LIBVER): $(LIBOBJS) compats.o
457
	$(CC) -shared -o $@ $(LIBOBJS) compats.o $(LDFLAGS) $(LDADD_MD5) \
458
		-Wl,${LINKER_SONAME},$@ $(LDLIBS) $(LIBS_PKG)
459
	ln -sf $@ `basename $@ .$(LIBVER)`
460

461
$(LIBOBJS): kcgi.h config.h extern.h
462

463
# Our companion libraries.
464
# There are many of these.
465

466
kcgihtml.o: kcgi.h config.h kcgihtml.h extern.h
467

468
kcgijson.o: kcgi.h config.h kcgijson.h extern.h
469

470
kcgixml.o: kcgi.h config.h kcgixml.h extern.h
471

472
kcgiregress.o: config.h kcgiregress.h
473

474
libkcgihtml.a: kcgihtml.o
475
	$(AR) rs $@ kcgihtml.o
476

477
libkcgijson.a: kcgijson.o
478
	$(AR) rs $@ kcgijson.o
479

480
libkcgixml.a: kcgixml.o
481
	$(AR) rs $@ kcgixml.o
482

483
libkcgiregress.a: kcgiregress.o
484
	$(AR) rs $@ kcgiregress.o
485

486
libkcgihtml.so.$(LIBVER): kcgihtml.o libkcgi.so.$(LIBVER)
487
	$(CC) -shared -o $@ kcgihtml.o $(LDFLAGS) \
488
		-Wl,${LINKER_SONAME},$@ $(LDLIBS) libkcgi.so.$(LIBVER)
489
	ln -sf $@ `basename $@ .$(LIBVER)`
490

491
libkcgijson.so.$(LIBVER): kcgijson.o libkcgi.so.$(LIBVER)
492
	$(CC) -shared -o $@ kcgijson.o $(LDFLAGS) \
493
		-Wl,${LINKER_SONAME},$@ $(LDLIBS) libkcgi.so.$(LIBVER)
494
	ln -sf $@ `basename $@ .$(LIBVER)`
495

496
libkcgixml.so.$(LIBVER): kcgixml.o libkcgi.so.$(LIBVER)
497
	$(CC) -shared -o $@ kcgixml.o $(LDFLAGS) \
498
		-Wl,${LINKER_SONAME},$@ $(LDLIBS) libkcgi.so.$(LIBVER)
499
	ln -sf $@ `basename $@ .$(LIBVER)`
500

501
libkcgiregress.so.$(LIBVER): kcgiregress.o libkcgi.so.$(LIBVER)
502
	$(CC) -shared -o $@ kcgiregress.o $(LDFLAGS) \
503
		-Wl,${LINKER_SONAME},$@ $(LDLIBS) libkcgi.so.$(LIBVER)
504
	ln -sf $@ `basename $@ .$(LIBVER)`
505

506
# Sample programs.
507
# These demonstrate FastCGI, CGI, and standard.
508

509
samplepp: samplepp.cc libkcgi.a libkcgihtml.a kcgi.h
510
	c++ $(CFLAGS) $(CFLAGS_PKG) $(LDADD_STATIC) -o $@ samplepp.cc -L. libkcgi.a $(LIBS_PKG) $(LDADD_MD5)
511

512
sample: sample.o libkcgi.a libkcgihtml.a kcgi.h kcgihtml.h
513
	$(CC) -o $@ $(LDADD_STATIC) sample.o -L. libkcgihtml.a libkcgi.a $(LIBS_PKG) $(LDADD_MD5)
514

515
sample-fcgi: sample-fcgi.o libkcgi.a kcgi.h
516
	$(CC) -o $@ $(LDADD_STATIC) sample-fcgi.o -L. libkcgi.a $(LIBS_PKG) $(LDADD_MD5)
517

518
sample-cgi: sample-cgi.o 
519
	$(CC) -o $@ $(LDADD_STATIC) sample-cgi.o 
520

521
# Now a lot of HTML and web media files.
522
# These are only used with the `www' target, so we can assume
523
# that they're running in-house for releases.
524

525
index.html: index.xml versions.xml $(THTMLS) $(MANHTMLS)
526
	sblg -t index.xml -s date -o- versions.xml $(THTMLS) $(MANHTMLS) >$@
527

528
sample.c.html: sample.c
529
	highlight -o $@ --inline-css --doc sample.c
530

531
samplepp.cc.html: samplepp.cc
532
	highlight -o $@ --inline-css --doc samplepp.cc
533

534
archive.html: archive.xml versions.xml $(THTMLS)
535
	sblg -t archive.xml -s date -o- versions.xml $(THTMLS) >$@
536

537
$(THTMLS): tutorial.xml versions.xml $(TXMLS)
538

539
extending01.html: extending01.xml tutorial.xml
540
	sblg -t tutorial.xml -o- -c $< | sed "s!@VERSION@!$(VERSION)!g" >$@
541

542
.xml.html:
543
	sblg -t tutorial.xml -s date -o- -C $< versions.xml $(TXMLS) | \
544
		sed "s!@VERSION@!$(VERSION)!g" >$@
545

546
.3.3.html .8.8.html:
547
	( echo "<!DOCTYPE html>" ; \
548
	  echo "<html lang=\"en\">" ; \
549
	  echo "<head>" ; \
550
	  echo "<meta charset=\"utf-8\"/>" ; \
551
	  echo "<link rel=\"stylesheet\" " \
552
	  	"href=\"https://bsd.lv/css/mandoc.css\" />" ; \
553
          echo "<title>`basename $<`</title>" ; \
554
	  echo "</head>" ; \
555
	  echo "<body>" ; \
556
	  echo "<article data-sblg-article=\"1\"" \
557
	  	"data-sblg-tags=\"man\" " \
558
		"data-sblg-title=\"`basename $<`\">" ; \
559
 	  mandoc -Ofragment -Thtml $< ; \
560
	  echo "</article>" ; \
561
	  echo "</body>" ; \
562
	  echo "</html>" ; ) >$@
563

564
atom.xml: versions.xml
565
	sblg -s date -a versions.xml >$@
566

567
.dot.svg:
568
	dot -Tsvg -o $@ $<
569

570
# Distribution files.
571
# Also only used with the `www' target.
572

573
kcgi.tgz.sha512: kcgi.tgz
574
	openssl dgst -sha512 -hex kcgi.tgz >$@
575

576
kcgi.tgz:
577
	mkdir -p .dist/kcgi-$(VERSION)
578
	mkdir -p .dist/kcgi-$(VERSION)/man
579
	mkdir -p .dist/kcgi-$(VERSION)/regress
580
	mkdir -p .dist/kcgi-$(VERSION)/afl
581
	install -m 0644 $(SRCS) *.in.pc .dist/kcgi-$(VERSION)
582
	install -m 0644 regress/*.c regress/*.h .dist/kcgi-$(VERSION)/regress
583
	install -m 0644 afl/*.c .dist/kcgi-$(VERSION)/afl
584
	install -m 0644 Makefile template.xml .dist/kcgi-$(VERSION)
585
	install -m 0644 $(MANS) .dist/kcgi-$(VERSION)/man
586
	install -m 0755 configure .dist/kcgi-$(VERSION)
587
	(cd .dist && tar zcf ../$@ kcgi-$(VERSION))
588
	rm -rf .dist
589

590
# Catch version updates.
591

592
$(PCS): kcgi.h
593

594
.in.pc.pc:
595
	sed -e "s!@PREFIX@!$(PREFIX)!g" \
596
	    -e "s!@LDADD_ZLIB@!$(LIBS_PKG)!g" \
597
	    -e "s!@LDADD_LIB_SOCKET@!$(LDADD_LIB_SOCKET)!g" \
598
	    -e "s!@LDADD_MD5@!$(LDADD_MD5)!g" \
599
	    -e "s!@LIBDIR@!$(LIBDIR)!g" \
600
	    -e "s!@INCLUDEDIR@!$(INCLUDEDIR)!g" \
601
	    -e "s!@VERSION@!$(VERSION)!g" $< >$@
602

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.