diff options
-rw-r--r-- | Makefile | 41 | ||||
-rw-r--r-- | Makefile.old | 47 |
2 files changed, 47 insertions, 41 deletions
@@ -1,14 +1,10 @@ -CFLAGS?=-g -O3 -Wall -Wextra -std=c99 -Isrc -Wno-missing-field-initializers -fPIC $(OPTCFLAGS) -LDFLAGS?=-g -O3 -Wall -Werror -fPIC $(OPTLDFLAGS) SRCDIR?=src DATADIR?=data BENCHINP?=README.md JSMODULES=$(wildcard js/lib/*.js) -PREFIX?=/usr/local SPEC=spec.txt SITE=_site SPECVERSION=$(shell grep version: $(SPEC) | sed -e 's/version: *//') - BUILDDIR=build PROG?=$(BUILDDIR)/src/cmark @@ -63,45 +59,9 @@ jshint: benchjs: node js/bench.js ${BENCHINP} -#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)/case_fold_switch.inc: $(DATADIR)/CaseFolding-3.2.0.txt perl mkcasefold.pl < $< > $@ -#$(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 - dingus: js/commonmark.js echo "Starting dingus server at http://localhost:9000" && python -m SimpleHTTPServer 9000 @@ -133,7 +93,6 @@ upload-site: cd $(SITE) ; git pull; git commit -a -m "Updated site for latest spec, js" ; git push; cd .. distclean: 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 diff --git a/Makefile.old b/Makefile.old new file mode 100644 index 0000000..bbfe06c --- /dev/null +++ b/Makefile.old @@ -0,0 +1,47 @@ +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 |