#
# Copyright (c) 1995-1996, 1998, 1999, 2000 University of Utah and the Flux Group.
# All rights reserved.
# 
# This file is part of the Flux OSKit.  The OSKit is free software, also known
# as "open source;" you can redistribute it and/or modify it under the terms
# of the GNU General Public License (GPL), version 2, as published by the Free
# Software Foundation (FSF).  To explore alternate licensing terms, contact
# the University of Utah at csl-dist@cs.utah.edu or +1-801-585-3271.
# 
# The OSKit is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GPL for more details.  You should have
# received a copy of the GPL along with the OSKit; see the file COPYING.  If
# not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA.
#

#
# This makefile fragment is used by all of the Unix-mode
# OSKit example directory GNUmakerules.
#

ifndef _oskit_examples_unix_unixmakerules_
_oskit_examples_unix_unixmakerules__ = yes

#
# -DOSKIT is still required in UNIX mode when compiling against the
# FreeBSD header files. (The contain #ifndef OSKIT statements).
# Dual-purpose example programs should use "#ifndef OSKIT_UNIX"
# instead of "ifdef OSKIT".
#
# OSKIT_UNIX is *only* used by the example programs.
#

OSKIT_CFLAGS += -DOSKIT -DOSKIT_UNIX

#
# Check for elf (linux, freebsd3) and assume that we're a.out
# (freebsd2) if we're not.
#
ifeq (${UNIX_OBJFORMAT},elf)
CRT0	= -e _start $(OBJDIR)/lib/unix/crt1.o
ifneq ($(HOST_ARCH),arm32)
CRT0	+= $(OBJDIR)/lib/unix/crti.o
CRTEND	= $(OBJDIR)/lib/unix/crtn.o
endif
else
CRT0	= -e start $(OBJDIR)/lib/unix/crt0.o
CRTEND	=
endif

LDFLAGS       = -nostdlib
CC           += -O -g

# Include the standard OSKit GNUmakerules
include $(OSKIT_SRCDIR)/GNUmakerules

endif
