@@ -19,16 +19,18 @@ CONFIGURE := configure
1919NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
2020VERSION := $(shell sed -ne 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' $(SRCDIR)/Main.hs)
2121EXECSBASE := $(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))
2722
2823#-------------------------------------------------------------------------------
2924# Install targets
3025#-------------------------------------------------------------------------------
31−WRAPPERS := html2markdown latex2markdown markdown2html markdown2latex markdown2pdf
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))
32+WRAPPERS := html2markdown latex2markdown markdown2html \
33+ markdown2latex markdown2pdf
3234PROGS := $(EXECS) $(WRAPPERS)
3335DOCS := README.html README BUGS TODO
3436
@@ -331,6 +333,7 @@ web_dest:=web/pandoc
331333make_page:=./$(MAIN) -s -B $(web_src)/header.html \
332334 -A $(web_src)/footer.html \
333335 -H $(web_src)/css
336+win_main:=$(basename $(MAIN)).exe
334337cleanup_files+=$(web_dest)
335338website: $(web_dest)
336339$(web_dest)/: $(MAIN) html $(tarball_name)
@@ -342,12 +345,17 @@ $(web_dest)/: $(MAIN) html $(tarball_name)
342345 echo "*** Missing ../$(deb_main). ***"; \
343346 exit 1; \
344347 }
348+ @[ -f $(win_main) ] || { \
349+ echo "*** Missing $(win_main). ***"; \
350+ exit 1; \
351+ }
345352 -rm -rf $(web_dest)
346353 ( \
347354 mkdir $(web_dest); \
348355 cp -r html $(web_dest)/doc; \
349356 cp ../$(osx_dmg_name) $(web_dest)/; \
350357 cp ../$(deb_main) $(web_dest)/; \
358+ cp $(win_main) $(web_dest)/; \
351359 cp $(tarball_name) $(web_dest)/; \
352360 cp $(web_src)/*.css $(web_dest)/; \
353361 sed -e 's#@PREFIX@#$(PREFIX)#g' $(osx_src)/Welcome | \
@@ -361,6 +369,8 @@ $(web_dest)/: $(MAIN) html $(tarball_name)
361369 sed -e 's/@TARBALL_NAME@/$(tarball_name)/g' $(web_src)/index.txt | \
362370 sed -e 's/@DEB_NAME@/$(deb_main)/g' | \
363371 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' | \
364374 $(make_page) > $(web_dest)/index.html; \
365375 ) || { rm -rf $(web_dest); exit 1; }
366376