27
Content-Disposition: inline; filename="
80c
Last-Modified: Tue, 12 May 2026 15:10:25 GMT
Expires: Fri, 09 May 2036 15:10:25 GMT
ETag: "bbfe06cd3c8bb08c79603547558cbc96433ff70b"

PREFIX?=/usr/local
SRCDIR?=src
CFLAGS?=-g -O3 -Wall -Wextra -std=c99 -Isrc -Wno-missing-field-initializers -fPIC $(OPTCFLAGS)
LDFLAGS?=-g -O3 -Wall -Werror -fPIC $(OPTLDFLAGS)

HTML_OBJ=$(SRCDIR)/html/html.o $(SRCDIR)/html/houdini_href_e.o $(SRCDIR)/html/houdini_html_e.o $(SRCDIR)/html/houdini_html_u.o

CMARK_OBJ=$(SRCDIR)/inlines.o $(SRCDIR)/buffer.o $(SRCDIR)/blocks.o $(SRCDIR)/scanners.c $(SRCDIR)/print.o $(SRCDIR)/utf8.o $(SRCDIR)/references.o

CMARK_HDR = $(SRCDIR)/cmark.h $(SRCDIR)/buffer.h $(SRCDIR)/references.h \
           $(SRCDIR)/chunk.h $(SRCDIR)/debug.h $(SRCDIR)/utf8.h \
           $(SRCDIR)/scanners.h $(SRCDIR)/inlines.h

HTML_HDR = $(SRCDIR)/html/html_unescape.h $(SRCDIR)/html/houdini.h

$(PROG): $(SRCDIR)/html/html_unescape.h $(SRCDIR)/case_fold_switch.inc $(HTML_OBJ) $(CMARK_OBJ) $(SRCDIR)/main.c
	$(CC) $(LDFLAGS) -o $@ $(HTML_OBJ) $(CMARK_OBJ) $(SRCDIR)/main.c

$(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re
	re2c --case-insensitive -bis $< > $@ || (rm $@ && false)


$(SRCDIR)/html/html_unescape.h: $(SRCDIR)/html/html_unescape.gperf
	gperf -I -t -N find_entity -H hash_entity -K entity -C -l
	--null-strings -m5 $< > $@

libcommonmark.so: $(HTML_OBJ) $(CMARK_OBJ)
	$(CC) $(LDFLAGS) -shared -o $@ $^

install: libcommonmark.so $(cmark_HDR) $(HTML_HDR)
	install -d $(PREFIX)/lib $(PREFIX)/include/cmark/html
	install libcommonmark.so $(PREFIX)/lib/
	install $(cmark_HDR) $(PREFIX)/include/cmark/
	install $(HTML_HDR) $(PREFIX)/include/cmark/html/

CMARK_HDR = $(SRCDIR)/cmark.h $(SRCDIR)/buffer.h $(SRCDIR)/references.h \
           $(SRCDIR)/chunk.h $(SRCDIR)/debug.h $(SRCDIR)/utf8.h \
           $(SRCDIR)/scanners.h $(SRCDIR)/inlines.h

HTML_HDR = $(SRCDIR)/html/html_unescape.h $(SRCDIR)/html/houdini.h

clean:
	-rm -f test $(SRCDIR)/*.o $(SRCDIR)/scanners.c $(SRCDIR)/html/*.o libcommonmark.so
	-rm -f js/commonmark.js
	-rm -rf *.dSYM
	-rm -f README.html
	-rm -f spec.md fuzz.txt spec.html

0

HTTP/1.0 500 Internal Server Error
Date: Tue, 12 May 2026 15:10:26 GMT
Server: OpenBSD httpd
Connection: close
Content-Type: text/html
Content-Length: 518

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>500 Internal Server Error</title>
<style type="text/css"><!--
body { background-color: white; color: black; font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif; }
hr { border: 0; border-bottom: 1px dashed; }
@media (prefers-color-scheme: dark) {
body { background-color: #1E1F21; color: #EEEFF1; }
a { color: #BAD7FF; }
}
--></style>
</head>
<body>
<h1>500 Internal Server Error</h1>
<hr>
<address>OpenBSD httpd</address>
</body>
</html>
