# 
# Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
# Licensed under the GPL
#

# struct stat64 changed the inode field name between 2.2 and 2.4 from st_ino
# to __st_ino.  It stayed in the same place, so as long as the correct name
# is used, hostfs compiled on 2.2 should work on 2.4 and vice versa.

STAT64_INO_FIELD := __st_ino

HOST_VER := $(shell uname -r | sed 's/^\(2\.[0-9]\)\..*/\1/')

ifeq ($(HOST_VER), 2.2)
  STAT64_INO_FIELD := st_ino
endif

EXTRA_CFLAGS += -I../../include
USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) \
	-DSTAT64_INO_FIELD=$(STAT64_INO_FIELD)

O_TARGET :=
obj-y = 
obj-m =

CFLAGS_hostfs_kern.o := $(CFLAGS)
CFLAGS_hostfs_user.o := $(USER_CFLAGS)

ifneq ($(CONFIG_HOSTFS), n)
  O_TARGET := hostfs.o
endif

obj-$(CONFIG_HOSTFS) += hostfs_kern.o hostfs_user.o

override CFLAGS =  

include $(TOPDIR)/Rules.make
