Skip to content
Snippets Groups Projects
Commit 21f5704d authored by Adam Wujek's avatar Adam Wujek :speech_balloon: Committed by Federico Vaga
Browse files

Makefile: split Makefile into Makefile and Kbuild


Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
parent fd618751
Branches
Tags
No related merge requests found
Kbuild 0 → 100644
zio-y := core.o chardev.o sysfs.o misc.o
zio-y += bus.o objects.o helpers.o dma.o
zio-y += buffers/zio-buf-kmalloc.o triggers/zio-trig-user.o
# Waiting for Kconfig...
CONFIG_ZIO_SNIFF_DEV:=y
zio-$(CONFIG_ZIO_SNIFF_DEV) += sniff-dev.o
obj-m = zio.o
obj-m += drivers/
obj-m += buffers/
obj-m += triggers/
# src is defined byt the kernel Makefile, but we want to use it also in our
# local Makefile (tools, lib)
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef CONFIG_CSM_VERSION
ccflags-y += -D"CERN_SUPER_MODULE=MODULE_VERSION(\"$(CONFIG_CSM_VERSION)\")"
else
ccflags-y += -DCERN_SUPER_MODULE=""
endif
# WARNING: the line below doesn't work in-kernel if you compile with O=
ccflags-y += -I$(src)/include/ -DGIT_VERSION=\"$(GIT_VERSION)\"
ccflags-y += $(ZIO_VERSION)
ccflags-$(CONFIG_ZIO_DEBUG) += -DDEBUG
LINUX ?= /lib/modules/$(shell uname -r)/build LINUX ?= /lib/modules/$(shell uname -r)/build
zio-y := core.o chardev.o sysfs.o misc.o GIT_VERSION := $(shell git describe --dirty --long --tags)
zio-y += bus.o objects.o helpers.o dma.o
zio-y += buffers/zio-buf-kmalloc.o triggers/zio-trig-user.o
# Waiting for Kconfig...
CONFIG_ZIO_SNIFF_DEV:=y
zio-$(CONFIG_ZIO_SNIFF_DEV) += sniff-dev.o
obj-m = zio.o
obj-m += drivers/
obj-m += buffers/
obj-m += triggers/
# src is defined byt the kernel Makefile, but we want to use it also in our
# local Makefile (tools, lib)
src ?= $(shell pwd)
GIT_VERSION := $(shell cd $(src); git describe --dirty --long --tags)
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef CONFIG_CSM_VERSION
ccflags-y += -D"CERN_SUPER_MODULE=MODULE_VERSION(\"$(CONFIG_CSM_VERSION)\")"
else
ccflags-y += -DCERN_SUPER_MODULE=""
endif
# Extract major, minor and patch number # Extract major, minor and patch number
ZIO_VERSION := -D__ZIO_MAJOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 1; ) ZIO_VERSION := -D__ZIO_MAJOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 1; )
ZIO_VERSION += -D__ZIO_MINOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 2; ) ZIO_VERSION += -D__ZIO_MINOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 2; )
ZIO_VERSION += -D__ZIO_PATCH_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 3) ZIO_VERSION += -D__ZIO_PATCH_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 3)
export ZIO_VERSION
# WARNING: the line below doesn't work in-kernel if you compile with O= export GIT_VERSION
ccflags-y += -I$(src)/include/ -DGIT_VERSION=\"$(GIT_VERSION)\" export ZIO_VERSION
ccflags-y += $(ZIO_VERSION)
ccflags-$(CONFIG_ZIO_DEBUG) += -DDEBUG
all: modules tools all: modules tools
......
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