changeset 647:ff94100cfc7c

Commonize README building.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 09 Jan 2015 20:37:15 +0200
parents 0768781ea1e5
children a9d25e083f44
files Makefile Makefile.gen Makefile.w32
diffstat 3 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jan 09 20:32:38 2015 +0200
+++ b/Makefile	Fri Jan 09 20:37:15 2015 +0200
@@ -18,6 +18,6 @@
 BINPATH=
 OBJPATH=obj/unix/
 EXEEXT=
-
+DOC=README
 
 include Makefile.gen
--- a/Makefile.gen	Fri Jan 09 20:32:38 2015 +0200
+++ b/Makefile.gen	Fri Jan 09 20:37:15 2015 +0200
@@ -57,6 +57,15 @@
 	$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
 
 #
+# Documentation
+#
+$(DOC):
+	@wget -qO- http://www.tnsp.org/~ccr/nnchat/ | tr '\n' '' | \
+	sed "s/<.-- BEGIN -->.*<.-- END -->//g;s/<script.*<\/script>//g" | tr '' '\n' > "$@.tmp"
+	@links -dump "$@.tmp" > $@
+
+
+#
 # Special targets
 #
 clean:
--- a/Makefile.w32	Fri Jan 09 20:32:38 2015 +0200
+++ b/Makefile.w32	Fri Jan 09 20:37:15 2015 +0200
@@ -16,6 +16,7 @@
 EXEEXT=.exe
 OBJPATH=obj/win32/
 BINPATH=installer/
+DOC=$(BINPATH)/README.html
 
 EXTRAOBJS= resource.o
 ICON=resource.ico
@@ -29,14 +30,6 @@
 	$(WINDRES) $< -O coff -o $@
 
 
-DOC=$(BINPATH)/README.html
-
-update-doc:
-	@wget -qO- http://www.tnsp.org/~ccr/nnchat/ | tr '\n' '' | sed "s/<.-- BEGIN -->.*<.-- END -->//g" | tr '' '\n' > "$(DOC).new"
-	@if diff -u "$(DOC)" "$(DOC).new" > /dev/null; then echo "No differences."; else cp "$(DOC).new" "$(DOC)"; fi
-
-$(DOC): update-doc
-
 upload: $(BINPATH)/nncsetup.msi $(DOC)
 	@scp $< ccr@tnsp.org:public_html/nnchat/nncsetup-$(NN_VERSION).msi
 	@touch $@