File: Makefile.osscore

package info (click to toggle)
oss4 4.2-build2010-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,000 kB
  • ctags: 24,671
  • sloc: ansic: 222,209; sh: 4,864; pascal: 2,334; asm: 1,189; makefile: 393; php: 53; xml: 46
file content (32 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
include /etc/oss.conf

EXTRA_CFLAGS += -I${OSSLIBDIR}/include/internals -I${OSSLIBDIR}/include/sys

ifneq ($(KERNELRELEASE),)

	obj-m := osscore.o

else

	KERNELDIR ?= /lib/modules/$(shell uname -r)/build
	PWD := $(shell pwd)
endif

default:
	@echo "static const char __oss_compile_vermagic[]" > ubuntu_version_hack.inc
#The kernel build system saves kernel version (obtained via "utsrelease.h")
#used during compile in a "vermagic" symbol. soundon compares this with
#current version of running kernel to know when to relink modules.
#Some Ubuntu kernels have  'uname -r' output different from "utsrelease.h"
#contents, so we save the previous uname as a fallback check.
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/247055
	@echo "__attribute__((used))" >> ubuntu_version_hack.inc
	@echo "__attribute__((section(\".modinfo\")))" >> ubuntu_version_hack.inc
	@echo "= \"$(shell /usr/sbin/ossvermagic -z -s)\";" >> ubuntu_version_hack.inc

	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
	@rm -f ubuntu_version_hack.inc

clean:
	rm -f *.o *.ko *.mod.c *.mod.o .*.cmd core core.* x y z ubuntu_version_hack.inc
	rm -rf .tmp_versions