# -*- Mode: makefile -*-
CPPFLAGS = -I. -I$(PATH1)

# For Mac OS X 10.2, gcc3 is appropriate.  For 10.4, gcc (gcc 4.0) is ok.  But
# this means -traditional is needed because gcc 4 seems to handle '##'
# differently from gcc-3.3.  I (rtoy) don't know which is right, but I
# think gcc 4 is wrong.  However, to work around this, we use /**/ to 
# concatenate tokens which reguires the -traditional flag.

# Build for OSX 10.4 or later.  (Is this what we want?)
OSX_VERSION=-mmacosx-version-min=10.4
CC = gcc
NM = $(PATH1)/darwin-nm
CPP = cpp
DEPEND_FLAGS = -MM

ifdef FEATURE_LINKAGE_TABLE
LINKAGE = -DLINKAGE_TABLE
endif

# Enable support for generational GC
ifdef FEATURE_GENCGC
GENCGC = -DGENCGC
GC_SRC = gencgc.c
endif

# Enable support for Unicode
ifdef FEATURE_UNICODE
UNICODE = -DUNICODE
endif

CFLAGS = $(OSX_VERSION) -g -O3 -ffp-contract=off -fno-omit-frame-pointer -DDARWIN -Dppc $(LINKAGE) $(GENCGC) $(UNICODE)
ASFLAGS = $(OSX_VERSION) -traditional -g -O3 -DDARWIN -Dppc $(LINKAGE) $(GENCGC)

UNDEFSYMPATTERN = -Xlinker -u -Xlinker &
ASSEM_SRC = ppc-assem.S linux-stubs.S
ARCH_SRC = ppc-arch.c
OS_SRC = os-common.c Darwin-os.c


ifdef FEATURE_EXECUTABLE
OS_SRC += mach-o.c
EXEC_FINAL_OBJ = exec-final.o
endif

# gcc 4.8, (used on zombie) needs -static-libgcc so that the gcc
# library is staticly linked into lisp so that the user doesn't need a
# matching version of libgcc.
OS_LINK_FLAGS = $(OSX_VERSION) -static-libgcc
OS_LIBS = -lSystem -lc -lm

