# Comment/uncomment the following line to enable/disable debugging
#DEBUG = y

# Change it here or specify it on the "make" commandline
include ../config.mk

INCLUDEDIR = /usr/include

ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DBRZ_DEBUG # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

CFLAGS = -D__KERNEL__ -DMODULE  $(DEBFLAGS) -Wall -DBRZ_USE_PROC
CFLAGS += $(PCDEBUG) -D__KERNEL__ -DMODULE -I../include -I../include/linux/config.h\
	   -I$(LINUX)/include -I$(LINUX)
CFLAGS += -I$(INCLUDEDIR)

# Extract version number from headers.
VER = $(shell awk -F\" '/REL/ {print $$2}' $(INCLUDEDIR)/linux/version.h)

TARGET = xbrzcom_cs
OBJS = $(TARGET).o
MODULES = $(TARGET).o	
SRC = Core.c Env.c StateMachine.c Security.c \
      Prot.c Queue.c FwLoadFlash.c FwLoadSRec.c brznet.c brzcom_cs.c \
      #iprs.c

all: .depend $(TARGET).o


$(TARGET).o: $(SRC:.c=.o)
	$(LD) -r $^ -o $@

#uses the same modules path as the rest of the pcmcia stuff
install: $(TARGET).o
	mkdir -p $(MODDIR)/pcmcia
	cp -fp $(MODULES) $(MODDIR)/pcmcia

clean:
	rm -f *.o *~ core .depend

depend .depend dep:
	$(CC) $(CFLAGS) -M *.c > $@


ifeq (.depend,$(wildcard .depend))
include .depend
endif

