Created
June 11, 2019 01:04
-
-
Save smzn/6a452143ccf3653f30ee04383128bfdb to your computer and use it in GitHub Desktop.
Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comment/uncomment the following line to enable/disable debugging | |
#DEBUG = y | |
# Add your debugging flag (or not) to CFLAGS | |
ifeq ($(DEBUG),y) | |
DEBFLAGS = -O -g # "-O" is needed to expand inlines | |
else | |
DEBFLAGS = -O2 | |
endif | |
EXTRA_CFLAGS += $(DEBFLAGS) | |
ifneq ($(KERNELRELEASE),) | |
# call from kernel build system | |
obj-m := chardev1.o | |
# chardev1-objs := chardev1.o | |
else | |
KERNELDIR ?= /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
modules: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules | |
endif | |
modules_install: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install | |
clean: | |
rm -rf *.o *~ core Module.* modules.* .depend .*.cmd *.ko *.mod.c .tmp_versions | |
.PHONY: modules modules_install clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment