inweb-bootstrap/Materials/macos32-make-settings.mk

86 lines
4.8 KiB
Makefile
Raw Normal View History

# The intools, a suite of command-line programs needed by Inform, need to
# be compiled by a C compiler. This is done by the standard "make" tool,
# but the details (what C compiler to use, for example) have to be different
# on different operating systems. This file, make-intools-settings.mk,
# contains those details.
# This is make-intools-settings.mk for Mac OS X.
# (0) Before we get under way, a few definitions which should apply on all
# platforms.
INTEST = intest/Tangled/intest
INWEB = inweb/Tangled/inweb
# (1) Our C compiler, "CC", must accept gcc-compatible command line switches,
# so it should probably be either gcc itself or else clang. We should define
# two symbols, "CC", our general-purpose C compiler, and "INDULGENTCC",
# set up to be rather more forgiving about warning conditions. "CC" will be
# used for code in active development, to keep us on the straight and narrow.
# "INDULGENTCC" is for code from older or externally written projects, which
# wouldn't stand up to the same scrutiny.
CC = clang -std=c99 -c $(MANYWARNINGS) $(CCOPTS) -g
INDULGENTCC = clang -std=c99 -c $(FEWERWARNINGS) $(CCOPTS) -g
# On Mac OS X, we assume the user has the Developer Tools installed:
CCOPTS = -DPLATFORM_MACOS=1 -mmacosx-version-min=10.4 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
# The strictness of "CC" comes about by enabling all warnings except:
# -Wno-pointer-arith: we use the gcc extension allowing (void *) pointers to increment, don't complain
# -Wno-variadic-macros: we use the gcc extension for variadic macros, don't complain
# -Wno-cast-align, -Wno-padded: we don't care about address alignments of structure elements
# -Wno-missing-noreturn: a few fatal-error functions could be marked with
# __attribute__((noreturn)) to prevent this, but gcc doesn't accept
# this except in a predeclaration, which is inconvenient for us
# -Wno-shadow: we don't care if an inner block defines a variable of the same name
# -Wno-unused-macros: a few constants are defined to document external formats rather than for use here
# -Wno-unused-parameter: we don't much care if a function argument isn't used
# -Wno-missing-prototypes: because Preform-defined routines aren't predeclared with prototypes
# -Wno-missing-variable-declarations: these are not for linking, so don't care about extern/static
# -Wno-unreachable-code-break: these derive from Preform-compiled switches, and are harmless
# -Wno-class-varargs: for some reason clang thinks structs shouldn't be passed to variable-argument functions
# -Wno-format-nonliteral: similarly, it thinks all format strings in |printf| should be literals
# -Wno-cast-qual: in OS X 10.11, clang became bothered by casts from (void *) if it thought they were const
# -Wno-double-promotion: in OS X 10.12, clang began warning of possible precision loss: we only need about 1% accuracy anyway
# -Wno-commas: in OS X 10.13, clang began warning about "possible misuse of comma operator" - by misuse, it means use
# -Wno-strict-prototypes: in OS X 10.13, clang began objecting to (some) function prototypes generated by macros
MANYWARNINGS = -Weverything -Wno-pointer-arith -Wno-unused-macros -Wno-shadow -Wno-cast-align -Wno-variadic-macros -Wno-missing-noreturn -Wno-missing-prototypes -Wno-unused-parameter -Wno-padded -Wno-missing-variable-declarations -Wno-unreachable-code-break -Wno-class-varargs -Wno-format-nonliteral -Wno-cast-qual -Wno-double-promotion -Wno-comma -Wno-strict-prototypes -ferror-limit=1000
FEWERWARNINGS = -Wno-implicit-int -Wno-dangling-else -Wno-pointer-sign -Wno-format-extra-args -Wno-tautological-compare -Wno-deprecated-declarations -Wno-logical-op-parentheses -Wno-format
# (2) We need a linker, "LINK". Nowadays some C compilers (e.g. clang on
# Mac OS X) can happily do their own linking, but on some Unix platforms
# we still want to use ld, so these symbols exist to make it possible to
# specify that.
LINK = clang $(CCOPTS) -g
LINKEROPTS =
# On some platforms, executables have a specific file extension, which we
# define here.
EXEEXTENSION =
# (3) We need an archive tool, "ARTOOL". The traditional archiver "ar -r"
# should be fine on most Unix systems, but for example OS X prefers a more
# modern replacement which can handle multiple-architecture binaries.
ARTOOL = libtool -o
# (4) Platform definition symbols.
# The I6 source code needs a constant defined to tell it what platform it'll
# be used on, so:
INFORM6OS = OSX
# The following is needed when compiling glulxe, as part of dumb-glulx, which
# is used in testing. For Mac OS X and probably all Unix-based systems, it
# wants to be OS_UNIX; for Windows it probably wants to be WIN32. See the file
# osdepend.c in the glulxe distribution.
GLULXEOS = OS_UNIX