Commit 68fcb2c2 authored by Federico Vaga's avatar Federico Vaga

sw:drv: improve makefile

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent d7854f2a
......@@ -3,19 +3,28 @@
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR ?= $(shell pwd)/../../
TRTL ?= $(TOP_DIR)
TRTL_SW := $(TRTL)/software
PREFIX ?= /
# If it exists includes Makefile.specific. In this Makefile, you should put
# specific Makefile code that you want to run before this. For example,
# build a particular environment.
-include Makefile.specific
# include parent_common.mk for buildsystem's defines
REPO_PARENT ?= $(TOD_DIR)/../
-include $(REPO_PARENT)/parent_common.mk
TRTL ?= $(TOP_DIR)
include $(TRTL)/common.mk
KVERSION ?= $(shell uname -r)
LINUX ?= /lib/modules/$(KVERSION)/build
DKMS ?= 0
GIT_VERSION = $(shell cd $(src); git describe --always --dirty --long --tags)
VERSION:= $(shell git describe --tags --abbrev=0 | tr -d 'v')
all modules: hw_header
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) DKMS=$(DKMS) modules
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) \
GIT_VERSION=$(GIT_VERSION) \
DKMS=$(DKMS) \
modules
hw_header:
ifeq ($(DKMS), 0)
......@@ -37,11 +46,7 @@ dkms_install: hw_header
@sed -r -i -e "s/@PKGVER@/$(VERSION)/" $($@_dir)/dkms.conf
# be able to run the "clean" rule even if $(LINUX) is not valid
clean:
rm -rf *.o *~ .*.cmd *.ko *.mod.c .tmp_versions Module.symvers \
Module.markers modules.order
coccicheck:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) coccicheck
coccicheck clean:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) INSTALL_MOD_PATH=$(PREFIX) $@
.PHONY: headers
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