Makefile 620 B

12345678910111213141516171819202122232425
  1. # Trying to do:
  2. # $(MAKE) -C '$(LINUX_DIR)' M='$(M)' hello.ko hello2.ko
  3. # to restrict which modules are built leads to failures
  4. # when doing parallel builds. The only solution I could find
  5. # was to let the host select obj-m itself.
  6. obj-m += $(OBJECT_FILES)
  7. ccflags-y := \
  8. -DDEBUG \
  9. -ggdb3 \
  10. -std=gnu99 \
  11. -Werror \
  12. -Wframe-larger-than=1000000000 \
  13. -Wno-declaration-after-statement \
  14. $(CCFLAGS)
  15. ifeq ($(ARCH),x86)
  16. # https://cirosantilli.com/linux-kernel-module-cheat#floating-point-in-kernel-modules
  17. CFLAGS_REMOVE_float.o += -mno-sse -mno-sse2
  18. endif
  19. .PHONY: all
  20. all:
  21. $(MAKE) -C '$(LINUX_DIR)' M='$(M)'