Advertisement
Gaiolero

Untitled

Aug 29th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. PWD := $(shell pwd)
  2. KSRC ?= /lib/modules/$(shell uname -r)/build
  3. KBUILD := $(KSRC)
  4. M ?= $(PWD)
  5.  
  6. ifeq ($(RTPENGINE_VERSION),)
  7. DPKG_PRSCHNGLG= $(shell which dpkg-parsechangelog 2>/dev/null)
  8. DEB_CHANGELOG=$(shell test -f $(M)/../debian/changelog && echo $(M)/../debian/changelog || echo $(M)/debian/changelog)
  9. ifneq ($(DPKG_PRSCHNGLG),)
  10. DPKG_PRSCHNGLG=$(shell dpkg-parsechangelog -l$(DEB_CHANGELOG) | awk '/^Version: / {print $$2}')
  11. endif
  12. GIT_BR_COMMIT=git-$(shell cd $(M) && git rev-parse --abbrev-ref --symbolic-full-name HEAD)-$(shell cd $(M) && git rev-parse --short HEAD)
  13.  
  14. ifneq ($(DPKG_PRSCHNGLG),)
  15. RTPENGINE_VERSION+=$(DPKG_PRSCHNGLG)
  16. endif
  17. ifneq ($(GIT_BR_COMMIT),)
  18. RTPENGINE_VERSION+=$(GIT_BR_COMMIT)
  19. endif
  20.  
  21. ifeq ($(RTPENGINE_VERSION),)
  22. RTPENGINE_VERSION+=undefined
  23. endif
  24. endif
  25. EXTRA_CFLAGS+= -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\""
  26.  
  27. EXTRA_CFLAGS += -D__RE_EXTERNAL
  28.  
  29. obj-m += xt_RTPENGINE.o
  30.  
  31. .PHONY: modules clean patch install
  32.  
  33. modules:
  34. make -C $(KBUILD) M=$(PWD) O=$(KBUILD) modules
  35.  
  36. clean:
  37. make -C $(KBUILD) M=$(PWD) clean || true
  38.  
  39. patch:
  40. ../utils/patch-kernel magic "$(PWD)" "$(KERNEL)" "$(RTPENGINE_VERSION)"
  41.  
  42. install:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement