# Makefile
#
#{{IS_NOTE
#
# Authors:	Tom M. Yeh
# Contributors:
# Create Date:	8/8/0 03:57PM
# $Header: /cvsroot/jedi/jdk/Makefile,v 1.10 2000/10/03 10:24:52 tomyeh Exp $
# Purpose:	Makefile of libjdk
# Description:
#	Note: we don't put platform dependent codes into separate directories
#	so that we can simplify Makefile (since we are building an 
#	indepedent target here).
#
#}}IS_NOTE
#
# Copyright (C) 2000 Infoshock Corporation. All Rights Reserved.
#
#{{IS_RIGHT
#}}IS_RIGHT
#

#/////////////////////////////////////////////
ifeq ($(__PLATFORM__),__i486__)
B_TARGET:=x86
else
ifeq ($(__PLATFORM__),__ARM__)
B_TARGET:=arm
else
ifeq ($(__PLATFORM__),__RTEMS__)
B_TARGET:=rtems
else
ERROR_MESSAGE:=$(__PLATFORM__) not supported yet
endif
endif
endif

B_TARGET:=jdk$(B_TARGET)$(DOT_LIBEXT)
B_TARGET2:= traps.h
C_LIST_EXTRA:= traps_h.i

ifneq ($(__OSL__),__WinCE__)
B_TARGET:=lib$(B_TARGET)
endif

#/////////////////////////////////////////////
O_LIST_IMAGE := _dummy_
	#libjdk is required only by JDK (jedi development kit), not jedi itself

ifeq ($(__OSL__),__WinCE__)
O_LIST := ce_start.o ce_main.o
else
O_LIST := elf_start.o
endif

#include rules
include $(TOPDIR)/Rules.make

ifeq ($(__OSL__),__WinCE__)
$(B_TARGET) : $(O_LIST)
	$(AR) /OUT:$@ /NOLOGO $(O_LIST)
	cp $@ $(JDKDIR)/lib
else
$(B_TARGET) : $(O_LIST)
	$(AR) rcs $@ $(O_LIST)
	cp $@ $(JDKDIR)/lib
endif

$(B_TARGET2): traps_h.i
	@echo "// This file is generated by Infoshock Jedi Tools" > $@
	@echo "// Any modification to this file will be lost in the next build" >> $@
	@echo "//" `date` >> $@
	@echo "// Copyright (c) Infoshock Corporation. All Rights Reserved" >> $@
	@sed -e '/^#line/d' -e '/^# [0-9]/d' -e 's/^_Define_/#define/' -e 's/^_EXTERN_C_/EXTERN_C/' -e's/^+++//' -e's/	*$$//' -e 's/ *$$//' -e '/^$$/d' $< >> $@
	cp $@ $(JDKDIR)/include/jdk

traps_h.i: $(TOPDIR)/include/anakin/_traps.h
