codaj12Driver_buildroot.mak 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Comment/uncomment the following line to disable/enable debugging
  2. #DEBUG = y
  3. # Add your debugging flag (or not) to CFLAGS
  4. ifeq ($(DEBUG),y)
  5. DEBFLAGS = -O -g # "-O" is needed to expand inlines
  6. else
  7. DEBFLAGS = -O2
  8. endif
  9. export ARCH=riscv
  10. export SUBARCH=riscv
  11. export CROSS_COMPILE=riscv64-buildroot-linux-gnu-
  12. DRV_PATH := $(shell pwd)/jdi/linux/driver
  13. EXTRA_CFLAGS += $(DEBFLAGS) -I$(LDDINCDIR) -Wall
  14. ifneq ($(KERNELRELEASE),)
  15. # call from kernel build system
  16. obj-m := jdec.o
  17. else
  18. default:
  19. $(MAKE) -C $(KERNELDIR) M=$(DRV_PATH) LDDINCDIR=$(DRV_PATH)/../include modules
  20. ifneq ($(INSTALL_MOD_PATH),)
  21. $(MAKE) -C $(KERNELDIR) M=$(DRV_PATH) LDDINCDIR=$(DRV_PATH)/../include \
  22. INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) modules_install
  23. endif
  24. endif
  25. clean:
  26. rm -rf $(DRV_PATH)/*.o $(DRV_PATH)/*~ $(DRV_PATH)/core $(DRV_PATH)/.depend $(DRV_PATH)/.*.cmd $(DRV_PATH)/*.ko $(DRV_PATH)/*.mod.c $(DRV_PATH)/modules.order $(DRV_PATH)/.tmp_versions $(DRV_PATH)/*.dwo $(DRV_PATH)/.*.dwo
  27. depend .depend dep:
  28. $(CC) $(CFLAGS) -M *.c > .depend
  29. ifeq (.depend,$(wildcard .depend))
  30. include .depend
  31. endif