#
# Copyright (c) 1996, 1998 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.
#

TARGET = liblinuxsys.a

SRCDIRS += $(OSKIT_SRCDIR)/examples/unix/linux 

LINUX_INCLUDES := -I$(OSKIT_SRCDIR)/examples/unix/linux

ifeq ($(HOST_ARCH), x86)
LINUX_INCLUDES +=	-I$(OSKIT_SRCDIR)/examples/unix/linux/linux/i386
SRCDIRS	+=		$(OSKIT_SRCDIR)/examples/unix/linux/linux/i386
else
warn:
	@echo "The oskit linux glue code dosen't support the "$(HOST_ARCH)" yet."
endif

LINUX_DEFINES = -DOSKIT -DHAVE_ELF -DHAVE_WEAK_SYMBOLS -D_LIBC


include $(OSKIT_SRCDIR)/GNUmakerules-lib

CFLAGS := -static $(LINUX_INCLUDES) $(LINUX_DEFINES)
ASFLAGS := $(LINUX_INCLUDES) $(LINUX_DEFINES) -DASSEMBLER


xlate_errno.o: xlate_errno.c
	$(CC) -c -o $@ $(OSKIT_CFLAGS) $<

xlate_errno.po: xlate_errno.c
	$(CC) -c -o $@ -DGPROF -pg $(OSKIT_CFLAGS) $<

xlate_sockopt.o: xlate_sockopt.c
	$(CC) -c -o $@ -I$(OSKIT_SRCDIR) -I$(OBJDIR) $(CFLAGS) $<

xlate_sockopt.po: xlate_sockopt.c
	$(CC) -c -o $@ -DGPROF -pg -I$(OSKIT_SRCDIR) -I$(OBJDIR) $(CFLAGS) $<


%.o: %.c
	$(CC) -c -o $@ $(CFLAGS) $<
%.o: %.S 
	$(CC) -c -o $@ $(ASFLAGS) $<

# For profiled versions.
%.po: %.c
	$(CC) -c -o $@ -DGPROF -pg $(CFLAGS) $<
%.po: %.S 
	$(CC) -c -o $@ -DGPROF -pg $(ASFLAGS) $<

