Makefile 630 B

12345678910111213141516171819202122232425262728
  1. ##
  2. # Copyright (C) 2021 Alibaba Group Holding Limited
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License version 2 as
  6. # published by the Free Software Foundation.
  7. ##
  8. TARGET = bm_demo
  9. obj-m +=$(TARGET).o
  10. $(TARGET)-objs += bm_demo_driver.o
  11. EXTRA_CFLAGS += -I$(PWD)/./
  12. EXTRA_CFLAGS += -I$(PWD)/../common/include
  13. PWD :=$(shell pwd)
  14. all:
  15. make -C $(KERNEL) M=$(PWD) modules
  16. modules_install:
  17. make -C $(KERNEL_SRC) M=$(SRC) modules_install
  18. clean:
  19. rm -rf $($(TARGET)-objs)
  20. if [ -d "$(KERNEL)" ]; then \
  21. make -C $(KERNEL) M=`pwd` clean; \
  22. fi