45 lines
1.1 KiB
Makefile
45 lines
1.1 KiB
Makefile
SHELL = /bin/bash
|
|
#
|
|
# optional makefile parameters:
|
|
# - DEBUG=<0|1>, enable verbose debug print-out in the driver
|
|
# - xvc_bar_num=, xvc pci bar #
|
|
# - xvc_bar_offset=, xvc register base offset
|
|
#
|
|
ifneq ($(xvc_bar_num),)
|
|
XVC_FLAGS += -D__XVC_BAR_NUM__=$(xvc_bar_num)
|
|
endif
|
|
|
|
ifneq ($(xvc_bar_offset),)
|
|
XVC_FLAGS += -D__XVC_BAR_OFFSET__=$(xvc_bar_offset)
|
|
endif
|
|
|
|
$(warning XVC_FLAGS: $(XVC_FLAGS).)
|
|
|
|
topdir := $(shell cd $(src)/.. && pwd)
|
|
|
|
TARGET_MODULE:=xdma
|
|
|
|
EXTRA_CFLAGS := -I$(topdir)/include $(XVC_FLAGS)
|
|
ifeq ($(DEBUG),1)
|
|
EXTRA_CFLAGS += -D__LIBXDMA_DEBUG__
|
|
endif
|
|
#EXTRA_CFLAGS += -DINTERNAL_TESTING
|
|
|
|
ifneq ($(KERNELRELEASE),)
|
|
$(TARGET_MODULE)-objs := libxdma.o xdma_cdev.o cdev_ctrl.o cdev_events.o cdev_sgdma.o cdev_xvc.o cdev_bypass.o xdma_mod.o xdma_thread.o
|
|
obj-m := $(TARGET_MODULE).o
|
|
else
|
|
BUILDSYSTEM_DIR:=/lib/modules/$(shell uname -r)/build
|
|
PWD:=$(shell pwd)
|
|
all :
|
|
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules
|
|
|
|
clean:
|
|
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) clean
|
|
@/bin/rm -f *.ko modules.order *.mod.c *.o *.o.ur-safe .*.o.cmd
|
|
|
|
install: all
|
|
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules_install
|
|
|
|
endif
|