Skip to content
Snippets Groups Projects
Commit 46f47e71 authored by Federico Vaga's avatar Federico Vaga
Browse files

[sw] install dkms sources


Signed-off-by: default avatarFederico Vaga <federico.vaga@cern.ch>
parent 9e8d5333
Branches
Tags
No related merge requests found
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 CERN
TOP_DIR ?= $(shell pwd)/..
-include Makefile.specific
# include parent_common.mk for buildsystem's defines
......@@ -5,11 +11,36 @@
REPO_PARENT ?= $(shell /bin/pwd)/..
-include $(REPO_PARENT)/parent_common.mk
GCORES ?= $(TOP_DIR)
include $(GCORES)/common.mk
DIR_NAME := general-cores-$(VERSION)
DST := $(PREFIX)/usr/src/$(DIR_NAME)/
DIRS := i2c-ocores
DIRS += spi-ocores
DIRS += htvic
.PHONY: all clean modules install modules_install
GIT ?= git
ifeq (,$(shell which $(GIT)))
$(error "Missing git")
endif
.PHONY: all clean modules install modules_install dkms_install
all clean modules install modules_install:
for D in $(DIRS); do $(MAKE) -C $$D $@; done
dkms_install:
$(eval $@_dst := $(shell mktemp -d))
@mkdir -p $($@_dst)
@mkdir -p $(DST)
@$(GIT) archive --format=tar -o $($@_dst)/$(DIR_NAME).tar --prefix=$(DIR_NAME)/ HEAD
@cd $($@_dst) && tar -xf $(DIR_NAME).tar
@mv $($@_dst)/$(DIR_NAME)/* $(DST) && rm -rf $($@_dst)
@cp $(GCORES)/common.mk $(DST)
@sed -e '2,$$d' -i $(DST)/common.mk
@sed -r -i -e "s/@PKGVER@/$(VERSION)/" $(DST)/dkms.conf
@sed -e "15d" -e "6,13d" -e "23,26d" -e '33,$$d' \
-i $(DST)/Makefile
@find $(DST) -name Makefile -exec \
sed -r -e "s,^(TOP_DIR.*)[.]{2}/?$$,\1," -i {} \;
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