chiark / gitweb /
The #definition of COMBINED was done very badly: it was a piece of
authorSimon Tatham <anakin@pobox.com>
Mon, 24 Jan 2005 12:09:51 +0000 (12:09 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 24 Jan 2005 12:09:51 +0000 (12:09 +0000)
platform-dependent code in puzzles.h (ick), which in turn depended
on the magic symbol MAC_OS_X being defined by mkfiles.pl itself
(yuck). Suddenly realised I can do much better simply by putting it
in an OS X makefile extras section in Recipe, and removing both
previous hacks. Much nicer.

[originally from svn r5191]

Recipe
mkfiles.pl
puzzles.h

diff --git a/Recipe b/Recipe
index fa1a78fd6be80c63db517ae1c088ea1c2706d817..6c4d3026f2ea99ec309efc7b5ed983a84f206a24 100644 (file)
--- a/Recipe
+++ b/Recipe
@@ -41,8 +41,11 @@ pattern  : [G] WINDOWS COMMON pattern
 # Mac OS X unified application containing all the puzzles.
 Puzzles  : [MX] osx osx.icns osx-info.plist COMMON ALL
 # For OS X, we must create the online help and include it in the
-# application bundle.)
+# application bundle.) Also we add -DCOMBINED to the compiler flags
+# so as to inform the code that we're building a single binary for
+# all the puzzles.
 !begin osx
+CFLAGS += -DCOMBINED
 Puzzles_extra = Puzzles.app/Contents/Resources/Help/index.html
 Puzzles.app/Contents/Resources/Help/index.html: \
        Puzzles.app/Contents/Resources/Help puzzles.but
index aa257ed7fd71144681ddd474e1a61d604634114e..8f3c7cf938b6f2bd8d061ab3fc01c6d878f06b58 100755 (executable)
@@ -1128,7 +1128,7 @@ if (defined $makefiles{'osx'}) {
     print
     "CC = \$(TOOLPATH)gcc\n".
     "\n".
-    &splitline("CFLAGS = -O2 -Wall -Werror -g -DMAC_OS_X " .
+    &splitline("CFLAGS = -O2 -Wall -Werror -g " .
               (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
     "LDFLAGS = -framework Cocoa\n".
     &splitline("all:" . join "", map { " $_" } &progrealnames("MX")) .
index d0882e3dc720b8e65e1b11b0f862b52375082dc8..4de81a78d9a919813abbb10c0894b69c4d4ae3bc 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -199,14 +199,6 @@ struct game {
     int (*wants_statusbar)(void);
 };
 
-/*
- * Here we include the knowledge of which platforms are of which
- * type.
- */
-#ifdef MAC_OS_X   /* this must be defined in the OS X Makefile */
-#define COMBINED
-#endif
-
 /*
  * For one-game-at-a-time platforms, there's a single structure
  * like the above, under a fixed name. For all-at-once platforms,