#
# @(#)GNUmakefile	1.4 99/02/01
#
# Makefile for green threads HPI.
#

BUILDDIR     = ../../..
LIBRARY      = hpi
PRODUCT      = java
THREADDIR    = green_threads
LIB_LOCATION = $(LIBDIR)/$(ARCH)/$(THREADDIR)
include $(BUILDDIR)/Platform.gmk
include $(BUILDDIR)/makefiles/Defs.gmk

#
# Green threads specific C and .s files.
#
FILES_c = \
	$(TARGDIR)clock.c \
	$(TARGDIR)context.c \
	$(TARGDIR)interrupt_md.c \
	$(TARGDIR)iomgr.c \
	$(TARGDIR)itimer.c \
	$(TARGDIR)monitor_md.c \
	$(TARGDIR)schedule.c \
	$(TARGDIR)signals.c \
	$(TARGDIR)synch.c \
	$(TARGDIR)sys_api_td.c \
	$(TARGDIR)threads_md.c \
	$(TARGDIR)mutex_md.c

ifeq ($(ARCH),i386)
    FILES_s = $(TARGDIR)edi.s
endif

#
# Other files/flags shared between the HPIs.
#
include $(BUILDDIR)/java/hpi/hpi_common.gmk

#
# Create the thread specific libdir.
#
INIT = $(LIBDIR)/$(ARCH)/$(THREADDIR)

#
# Workaround header file incompatibility between Solaris 2.5/6 and 2.7.
#
ifeq ($(PLATFORM),solaris)
ifeq ($(CC_VERSION),gcc)
ifneq ($(shell uname -r),"5.7")
CPPFLAGS_COMMON += -D_OLDER_SOLARIS_SYS_SOCKET_H
endif
endif
endif

#
# Rules for the .so file.
#
include $(BUILDDIR)/makefiles/Library.gmk

$(LIBDIR)/$(ARCH)/$(THREADDIR):
	mkdir -p $@
