Merge pull request #2 from AnthonyWharton/master

Add check for linux-header in kernel Makefile
This commit is contained in:
Andreas Abel
2019-02-21 17:28:20 +01:00
committed by GitHub
2 changed files with 23 additions and 1 deletions

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
# Catch all's
*.cmd
*.o
# Kernel ignore files/directories
kernel/.tmp_versions/
kernel/Module.symvers
kernel/modules.order
kernel/nb.ko
kernel/nb.mod.c
# User ignore files
user/nanoBench

View File

@@ -1,5 +1,14 @@
MODULE_NAME = nb
BUILD_DIR = /lib/modules/$(shell uname -r)/build
HEADERS_EXIST = $(shell if [ -d "${BUILD_DIR}" ]; then echo "${BUILD_DIR}"; \
else echo ""; fi)
ifneq (${HEADERS_EXIST}, ${BUILD_DIR})
$(warning "Check you have linux headers installed")
$(error "${BUILD_DIR} does not exist!")
endif
SRC := nb_km.c ../common/nanoBench.c
$(MODULE_NAME)-objs += $(SRC:.c=.o)
@@ -17,4 +26,4 @@ all:
clean:
rm -f ../common/*.o ../common/*.ur-safe
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean