# Numerical asic numbers (borrowed from ThreadX build).  The numbers don't really
# matter, but newer ASIC revisions must have higher numbers!
ASIC_REV_A0 = 50
ASIC_REV_B0 = 90
FILE_NAME=stepper-mod
# Look at the build command line for the asic revision.  At this point the stepper
# driver supports two big buckets of asic revisions:
#   - A0, supports up to 8 usteps
#   - Everything else, supports up to 16 usteps
ifeq ($(ASIC_REV), a0)
  ASIC_REV_NUM = $(ASIC_REV_A0)
else
  # default to b0
  ASIC_REV = b0
  ASIC_REV_NUM = $(ASIC_REV_B0)
endif

# Pass all the possible numerical asic revisions on to the code to support
# conditional compilation
ccflags-y += -DASIC_REV_A0=$(ASIC_REV_A0) \
             -DASIC_REV_B0=$(ASIC_REV_B0)

# Set up based on supplied ASIC revision (include path and define for conditional compile)
ccflags-y += -I$(src)/asic/88pa6270/$(ASIC_REV)
ccflags-y += -DASIC_REV=$(ASIC_REV_NUM)


# Stepper motor module makefile

obj-m := $(FILE_NAME)-$(ASIC_REV).o

# start building the file list
#
$(FILE_NAME)-$(ASIC_REV)-y := 

STEPPER_SRC=stepper_cdma.c

# convert all paths to something kbuild can find
$(FILE_NAME)-$(ASIC_REV)-y += $(STEPPER_SRC:%.c=%.o)

