Commit 14f5bc88 authored by Federico Vaga's avatar Federico Vaga

zio: fix building system get correct version everywhere

Signed-off-by: Federico Vaga's avatarfederico.vaga@cern.ch <federico.vaga@cern.ch>
parent e571218f
......@@ -4,22 +4,10 @@
REPO_PARENT ?= ..
-include $(REPO_PARENT)/parent_common.mk
LINUX ?= /lib/modules/$(shell uname -r)/build
GIT_VERSION := $(shell git describe --dirty --long --tags)
# 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_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)
export GIT_VERSION
export ZIO_VERSION
all: modules tools
modules:
$(MAKE) -C drivers/zio M=$(shell /bin/pwd)
$(MAKE) -C drivers/zio
.PHONY: tools
......@@ -29,8 +17,5 @@ tools:
# this make clean is ugly, I'm aware...
clean:
rm -rf `find . -name \*.o -o -name \*.ko -o -name \*~ `
rm -rf `find . -name Module.\* -o -name \*.mod.c`
rm -rf `find . -name \*.ko.cmd -o -name \*.o.cmd`
rm -rf .tmp_versions modules.order
$(MAKE) -C drivers/zio clean
$(MAKE) -C tools clean
# build user-space tools for zio
GIT_VERSION := $(shell git describe --dirty --long --tags | grep -o -E "[^v]*")
# Extract major, minor and patch number
ZIO_VERSION := -D__ZIO_MAJOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 1; )
ZIO_VERSION += -D__ZIO_MINOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 2; )
ZIO_VERSION += -D__ZIO_PATCH_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 3; )
CFLAGS = -I$(M)/include/ -Wall $(ZIO_VERSION) $(EXTRACFLAGS)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
......
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