Commit 4891cbae authored by xulei's avatar xulei

Makefile_new

parent 2af51c1c
obj-m += tms.o
tms-y = src/tms.o
-include path.mk
SRC := $(shell pwd)
#Options
#Enable debug
DEBUG=y
ARCH=arm64
ifndef KERNEL_DIR
$(error KERNEL_DIR is not defined, use: make KERNEL_DIR=<path to kernel directory> CROSS_COMPILE=<path to crosscompiler>)
endif
ifndef CROSS_COMPILE
$(error CROSS_COMPILE is not defined, use: make KERNEL_DIR=<path to kernel directory> CROSS_COMPILE=<path to crosscompiler>)
endif
# Add your debugging flag (or not) to EXTRA_CFLAGS
ifeq ($(DEBUG),y)
DEBFLAGS = -O -g -DSBULL_DEBUG # "-O" is needed to expand inlines
else
# DEBFLAGS = -fverbose-asm -O2
# DEBFLAGS = -Wa -adhln -g -fverbose-asm -marm -O2
DEBFLAGS = -O2
endif
EXTRA_CFLAGS += $(DEBFLAGS) -DKERNEL -D__KERNEL__
EXTRA_CFLAGS += -I$(SRC)/include
default:
@echo "Build default"
$(MAKE) modules -C $(KERNEL_DIR) M=$(SRC) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
all:
@echo "Build all"
$(MAKE) -C $(KERNEL_DIR) M=$(SRC) EXTRA_CFLAGS="$(EXTRA_CFLAGS)"
modules_install:
$(MAKE) -C $(KERNEL_DIR) M=$(SRC) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" modules_install
clean:
rm -rf src/*.o src/*.cmd src/.*.cmd *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.symvers modules.order
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment