| 1 | # -*- sh -*- |
| 2 | # Build script to build Puzzles. |
| 3 | |
| 4 | module puzzles |
| 5 | |
| 6 | # First build some local binaries, to run the icon build. |
| 7 | in puzzles do perl mkfiles.pl |
| 8 | in puzzles do make |
| 9 | |
| 10 | # Now build the screenshots and icons. |
| 11 | in puzzles/icons do xvfb-run make web winicons gtkicons |
| 12 | |
| 13 | # Re-run mkfiles.pl now that it knows the icons are there. |
| 14 | in puzzles do perl mkfiles.pl |
| 15 | |
| 16 | # Destroy the local binaries, mostly to avoid wasting network |
| 17 | # bandwidth by transferring them to the delegate servers. |
| 18 | in puzzles do make clean |
| 19 | |
| 20 | # Build the OS X .dmg archive. |
| 21 | delegate osx |
| 22 | in puzzles do make -f Makefile.osx clean |
| 23 | in puzzles do make -f Makefile.osx release VER=-DREVISION=$(revision) |
| 24 | return puzzles/Puzzles.dmg |
| 25 | enddelegate |
| 26 | |
| 27 | # Build the Windows binaries and installer, and the CHM file. |
| 28 | in puzzles do make -f Makefile.doc clean |
| 29 | in puzzles do make -f Makefile.doc chm |
| 30 | in puzzles do make -f Makefile.doc # build help file for installer |
| 31 | in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss |
| 32 | delegate windows |
| 33 | # Ignore the poorly controlled return value from HHC, and instead |
| 34 | # just test that the output file was generated. |
| 35 | in puzzles do hhc puzzles.hhp; test -f puzzles.chm |
| 36 | # FIXME: Cygwin alternative? |
| 37 | in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean' |
| 38 | in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)' |
| 39 | # Build installer. |
| 40 | in puzzles do iscc puzzles.iss |
| 41 | return puzzles/puzzles.chm |
| 42 | return puzzles/*.exe |
| 43 | return puzzles/Output/setup.exe |
| 44 | enddelegate |
| 45 | |
| 46 | # Build the help file and the HTML docs. |
| 47 | in puzzles do make -f Makefile.doc clean # remove CHM-target HTML |
| 48 | in puzzles do make -f Makefile.doc # and rebuild help file... |
| 49 | in puzzles do mkdir doc |
| 50 | in puzzles do mkdir devel |
| 51 | in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but |
| 52 | in puzzles/devel do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../devel.but |
| 53 | |
| 54 | # Move the deliver-worthy Windows binaries (those specified in |
| 55 | # wingames.lst, which is generated by mkfiles.pl and helpfully |
| 56 | # excludes the command-line auxiliary utilities such as solosolver, |
| 57 | # and nullgame.exe) into a subdirectory for easy access. |
| 58 | in puzzles do mkdir winbin |
| 59 | in puzzles do mv `cut -f1 -d: wingames.lst` winbin |
| 60 | |
| 61 | # Make a zip file of the Windows binaries and help files. |
| 62 | in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt |
| 63 | |
| 64 | # Create the source archive. (That writes the archive into the |
| 65 | # _parent_ directory, so be careful when we deliver it.) |
| 66 | in puzzles do ./makedist.sh $(revision) |
| 67 | |
| 68 | # Set up .htaccess containing a redirect for the archive filename. |
| 69 | in puzzles do echo "AddType application/octet-stream .chm" > .htaccess |
| 70 | in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess |
| 71 | in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess |
| 72 | in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess |
| 73 | in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-r$(revision)-installer.exe >> .htaccess |
| 74 | |
| 75 | # Phew, we're done. Deliver everything! |
| 76 | deliver puzzles/icons/*-web.png $@ |
| 77 | deliver puzzles/winbin/*.exe $@ |
| 78 | deliver puzzles/.htaccess $@ |
| 79 | deliver puzzles/doc/*.html doc/$@ |
| 80 | deliver puzzles/devel/*.html devel/$@ |
| 81 | deliver puzzles/Puzzles.dmg $@ |
| 82 | deliver puzzles/puzzles.chm $@ |
| 83 | deliver puzzles/puzzles.hlp $@ |
| 84 | deliver puzzles/puzzles.cnt $@ |
| 85 | deliver puzzles/puzzles.zip $@ |
| 86 | deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe |
| 87 | # This one isn't in the puzzles subdir, because makedist.sh left it |
| 88 | # one level up. |
| 89 | deliver puzzles*.tar.gz $@ |