#
# Copyright (C) 1998 David A. Hinds -- dhinds@pcmcia.sourceforge.org
#
# Makefile 1.105 1999/12/28 22:51:28
#

# Include site dependent options and kernel configuration
include ../config.mk

# Don't remove "-O2" or bad things will happen!  We use -O2 rather
# than -O3 because it yields smaller code; this is not performance
# critical stuff.

CFLAGS = -O2 -Wall -Wstrict-prototypes -pipe
CPPFLAGS := $(CPPFLAGS) $(PCDEBUG) -D__KERNEL__ -DMODULE

CC := $(CC) $(AFLAGS) $(KFLAGS)

ifndef CONFIG_PCMCIA

SRCS = i82365.c tcic.c cs.c cistpl.c rsrc_mgr.c bulkmem.c ds.c
CORE = cs.o cistpl.o rsrc_mgr.o bulkmem.o
MODULES = i82365.o tcic.o pcmcia_core.o ds.o

ifdef CONFIG_CARDBUS
SRCS := $(SRCS) cardbus.c cb_enabler.c
CORE := $(CORE) cardbus.o
MODULES := $(MODULES) cb_enabler.o
endif

endif

ifdef CONFIG_PNP_BIOS
SRCS := $(SRCS) pnp_bios.c pnp_proc.c pnp_rsrc.c
CORE := $(CORE) pnp_bios.o pnp_proc.o pnp_rsrc.o
endif

all:	$(MODULES)

pcmcia_core.o: $(CORE)
	$(LD) -r -o pcmcia_core.o $(CORE)
	chmod -x pcmcia_core.o

clean:
	rm -f core core.* *.o .*.o *.s *.a *~ .depend .depfiles/*.d

install install-modules: $(MODULES)
	mkdir -p $(PREFIX)/$(MODDIR)/pcmcia
	cp $(MODULES) $(PREFIX)/$(MODDIR)/pcmcia

include ../rules.mk
