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

# This Makefile has been simplified as much as possible, by putting all
# generic material, independent of this specific directory, into
# Rules.make. Read that file for details

include Rules.make

# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DTMK1553BUSB_DEBUG # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

CFLAGS += $(DEBFLAGS)
CFLAGS += -I..

TARGET = tmk1553busb.ko
OBJS = tmk1553usb.o tmklllin.o tmknllio.o

all: $(TARGET)

$(TARGET): $(OBJS)
	$(LD) -r $(OBJS) -o $(TARGET)

.o:.c
	$(CC) $(CFLAGS) -c $^ -o $@

install:
	install -d $(INSTALLDIR)
	install -c $(TARGET) $(INSTALLDIR)

clean:
	rm -f *.o *~ core