@@ -19,16 +19,18 @@ CONFIGURE := configure
19NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
19NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
20VERSION := $(shell sed -ne 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' $(SRCDIR)/Main.hs)
20VERSION := $(shell sed -ne 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' $(SRCDIR)/Main.hs)
21EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
21EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
22−# Add .exe extensions if we're running Windows/Cygwin.
23−EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | sed -ne 's/^cygwin.*$$/\.exe/p')
24−EXECS := $(patsubst %,%$(EXTENSION),$(EXECSBASE))
25−# First entry in Cabal's executable stanza is the main executable.
26−MAIN := $(firstword $(EXECS))
28#-------------------------------------------------------------------------------
23#-------------------------------------------------------------------------------
29# Install targets
24# Install targets
30#-------------------------------------------------------------------------------
25#-------------------------------------------------------------------------------
26+# Add .exe extensions if we're running Windows/Cygwin.
27+EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \
28+ sed -ne 's/^cygwin.*$$/\.exe/p')
29+EXECS := $(addsuffix $(EXTENSION),$(EXECSBASE))
30+# First entry in Cabal's executable stanza is the main executable.
31+MAIN := $(firstword $(EXECS))
31−WRAPPERS := html2markdown latex2markdown markdown2html markdown2latex markdown2pdf
32+WRAPPERS := html2markdown latex2markdown markdown2html \
33+ markdown2latex markdown2pdf
32PROGS := $(EXECS) $(WRAPPERS)
34PROGS := $(EXECS) $(WRAPPERS)
33DOCS := README.html README BUGS TODO
35DOCS := README.html README BUGS TODO
@@ -331,6 +333,7 @@ web_dest:=web/pandoc
331make_page:=./$(MAIN) -s -B $(web_src)/header.html \
333make_page:=./$(MAIN) -s -B $(web_src)/header.html \
332 -A $(web_src)/footer.html \
334 -A $(web_src)/footer.html \
333 -H $(web_src)/css
335 -H $(web_src)/css
336+win_main:=$(basename $(MAIN)).exe
334cleanup_files+=$(web_dest)
337cleanup_files+=$(web_dest)
335website: $(web_dest)
338website: $(web_dest)
336$(web_dest)/: $(MAIN) html $(tarball_name)
339$(web_dest)/: $(MAIN) html $(tarball_name)
@@ -342,12 +345,17 @@ $(web_dest)/: $(MAIN) html $(tarball_name)
342 echo "*** Missing ../$(deb_main). ***"; \
345 echo "*** Missing ../$(deb_main). ***"; \
343 exit 1; \
346 exit 1; \
348+ @[ -f $(win_main) ] || { \
349+ echo "*** Missing $(win_main). ***"; \
345 -rm -rf $(web_dest)
352 -rm -rf $(web_dest)
347 mkdir $(web_dest); \
354 mkdir $(web_dest); \
348 cp -r html $(web_dest)/doc; \
355 cp -r html $(web_dest)/doc; \
349 cp ../$(osx_dmg_name) $(web_dest)/; \
356 cp ../$(osx_dmg_name) $(web_dest)/; \
350 cp ../$(deb_main) $(web_dest)/; \
357 cp ../$(deb_main) $(web_dest)/; \
358+ cp $(win_main) $(web_dest)/; \
351 cp $(tarball_name) $(web_dest)/; \
359 cp $(tarball_name) $(web_dest)/; \
352 cp $(web_src)/*.css $(web_dest)/; \
360 cp $(web_src)/*.css $(web_dest)/; \
353 sed -e 's#@PREFIX@#$(PREFIX)#g' $(osx_src)/Welcome | \
361 sed -e 's#@PREFIX@#$(PREFIX)#g' $(osx_src)/Welcome | \
@@ -361,6 +369,8 @@ $(web_dest)/: $(MAIN) html $(tarball_name)
361 sed -e 's/@TARBALL_NAME@/$(tarball_name)/g' $(web_src)/index.txt | \
369 sed -e 's/@TARBALL_NAME@/$(tarball_name)/g' $(web_src)/index.txt | \
362 sed -e 's/@DEB_NAME@/$(deb_main)/g' | \
370 sed -e 's/@DEB_NAME@/$(deb_main)/g' | \
363 sed -e 's/@OSX_DMG_NAME@/$(osx_dmg_name)/g' | \
371 sed -e 's/@OSX_DMG_NAME@/$(osx_dmg_name)/g' | \
372+ sed -e 's/@WINDOWS_EXE_NAME@/$(win_main)/g' | \
373+ sed -e 's/@VERSION@/$(VERSION)/g' | \
364 $(make_page) > $(web_dest)/index.html; \
374 $(make_page) > $(web_dest)/index.html; \
365 ) || { rm -rf $(web_dest); exit 1; }
375 ) || { rm -rf $(web_dest); exit 1; }