aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-07-11 08:51:06 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-07-11 08:51:06 -0400
commit068cfc3f190cb901c9ab36e76db01bb09373e0f9 (patch)
treeaf12559efc0023e725826b105f8a14624fa9217c
parent5e1cee01ba46cffef72bae9c98d025a1c6cf7011 (diff)
Port Makefile to new Linux kernel header layout
The userspace versions of unistd.h have moved to include/uapi/asm in recent kernel versions; we need to adjust the liblitmus Makefile accordingly. Further, on x86, the unistd_32.h and unistd_64.h files are now actually being auto-generated; this also forced adjustments. This patch is required for liblitmus to compile against Linux 3.10.
-rw-r--r--Makefile23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index f6b00a0..e8003e8 100644
--- a/Makefile
+++ b/Makefile
@@ -36,16 +36,18 @@ include-sparc64 = sparc
36include-${ARCH} ?= ${ARCH} 36include-${ARCH} ?= ${ARCH}
37 37
38# name of the file(s) that holds the actual system call numbers 38# name of the file(s) that holds the actual system call numbers
39unistd-i386 = unistd.h unistd_32.h 39unistd-i386 = uapi/asm/unistd.h generated/uapi/asm/unistd_32.h
40unistd-x86_64 = unistd.h unistd_64.h 40unistd-x86_64 = uapi/asm/unistd.h generated/uapi/asm/unistd_64.h
41# default: unistd.h 41# default: unistd.h
42unistd-${ARCH} ?= unistd.h 42unistd-${ARCH} ?= uapi/asm/unistd.h
43 43
44# by default we use the local version 44# by default we use the local version
45LIBLITMUS ?= . 45LIBLITMUS ?= .
46 46
47# where to find header files 47# where to find header files
48headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include 48headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include
49headers += -I${LIBLITMUS}/arch/${include-${ARCH}}/include/uapi
50headers += -I${LIBLITMUS}/arch/${include-${ARCH}}/include/generated/uapi
49 51
50# combine options 52# combine options
51CPPFLAGS = ${flags-api} ${flags-${ARCH}} -DARCH=${ARCH} ${headers} 53CPPFLAGS = ${flags-api} ${flags-${ARCH}} -DARCH=${ARCH} ${headers}
@@ -148,8 +150,13 @@ include/litmus/%.h: ${LITMUS_KERNEL}/include/litmus/%.h
148 cp $< $@ 150 cp $< $@
149 151
150# asm headers 152# asm headers
151arch/${include-${ARCH}}/include/asm/%.h: \ 153arch/${include-${ARCH}}/include/uapi/asm/%.h: \
152 ${LITMUS_KERNEL}/arch/${include-${ARCH}}/include/asm/%.h 154 ${LITMUS_KERNEL}/arch/${include-${ARCH}}/include/uapi/asm/%.h
155 @mkdir -p ${dir $@}
156 cp $< $@
157
158arch/${include-${ARCH}}/include/generated/uapi/asm/%.h: \
159 ${LITMUS_KERNEL}/arch/${include-${ARCH}}/include/generated/uapi/asm/%.h
153 @mkdir -p ${dir $@} 160 @mkdir -p ${dir $@}
154 cp $< $@ 161 cp $< $@
155 162
@@ -160,7 +167,7 @@ litmus-headers = \
160 include/litmus/unistd_64.h 167 include/litmus/unistd_64.h
161 168
162unistd-headers = \ 169unistd-headers = \
163 $(foreach file,${unistd-${ARCH}},arch/${include-${ARCH}}/include/asm/$(file)) 170 $(foreach file,${unistd-${ARCH}},arch/${include-${ARCH}}/include/$(file))
164 171
165 172
166imported-headers = ${litmus-headers} ${unistd-headers} 173imported-headers = ${litmus-headers} ${unistd-headers}
@@ -266,7 +273,7 @@ $(error Cannot build without access to the LITMUS^RT kernel source)
266endif 273endif
267 274
268kernel-unistd-hdrs := $(foreach file,${unistd-headers},${LITMUS_KERNEL}/$(file)) 275kernel-unistd-hdrs := $(foreach file,${unistd-headers},${LITMUS_KERNEL}/$(file))
269hdr-ok := $(shell egrep '\#include ["<]litmus/unistd' ${kernel-unistd-hdrs} ) 276hdr-ok := $(shell egrep '\#include ["<]litmus/unistd|__NR_litmus_lock' ${kernel-unistd-hdrs} )
270ifeq ($(strip $(hdr-ok)),) 277ifeq ($(strip $(hdr-ok)),)
271$(info (!!) Could not find LITMUS^RT system calls in ${kernel-unistd-hdrs}.) 278$(info (!!) Could not find LITMUS^RT system calls in ${kernel-unistd-hdrs}.)
272$(error Your kernel headers do not seem to be LITMUS^RT headers) 279$(error Your kernel headers do not seem to be LITMUS^RT headers)