# -*- Mode: makefile -*-

CPP_DEFINE_OPTIONS := -Di386

# Enable support for :linkage-table feature.
ifdef FEATURE_LINKAGE_TABLE
CPP_DEFINE_OPTIONS += -DLINKAGE_TABLE
endif

# Enable support for generational GC
ifdef FEATURE_GENCGC
CPP_DEFINE_OPTIONS += -DGENCGC
GC_SRC := gencgc.c
else
GC_SRC := cgc.c
CPP_DEFINE_OPTIONS += -DWANT_CGC
endif

# Enable support for SSE2.  If FEATURE_X87 is set, we want SSE2
# support in the C code too so that the same binary is built in both
# cases.  If neither is set, then we don't want any SSE2 support at
# all.
ifdef FEATURE_X87
CPP_DEFINE_OPTIONS += -DFEATURE_SSE2
else
ifdef FEATURE_SSE2
CPP_DEFINE_OPTIONS += -DFEATURE_SSE2
endif
endif

ifdef FEATURE_UNICODE
CPP_DEFINE_OPTIONS += -DUNICODE
endif

ifdef FEATURE_ELF
CPP_DEFINE_OPTIONS += -DFEATURE_ELF
endif

ifeq ($(filter 2% 3%, $(shell $(CC) -dumpversion)),)
CPP_INCLUDE_OPTIONS := -iquote . -iquote $(PATH1)
else
CPP_INCLUDE_OPTIONS := -I. -I$(PATH1) -I-
endif

CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS) 
CFLAGS += -Wstrict-prototypes -Wall -O2 -g -fno-omit-frame-pointer
ASFLAGS = -g 

ASSEM_SRC = x86-assem.S
ARCH_SRC = x86-arch.c
OS_SRC = os-common.c

NM = nm -gp
DEPEND_FLAGS = -MM
