diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-11 08:51:06 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-11 08:51:06 -0400 |
commit | 068cfc3f190cb901c9ab36e76db01bb09373e0f9 (patch) | |
tree | af12559efc0023e725826b105f8a14624fa9217c | |
parent | 5e1cee01ba46cffef72bae9c98d025a1c6cf7011 (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-- | Makefile | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -36,16 +36,18 @@ include-sparc64 = sparc | |||
36 | include-${ARCH} ?= ${ARCH} | 36 | include-${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 |
39 | unistd-i386 = unistd.h unistd_32.h | 39 | unistd-i386 = uapi/asm/unistd.h generated/uapi/asm/unistd_32.h |
40 | unistd-x86_64 = unistd.h unistd_64.h | 40 | unistd-x86_64 = uapi/asm/unistd.h generated/uapi/asm/unistd_64.h |
41 | # default: unistd.h | 41 | # default: unistd.h |
42 | unistd-${ARCH} ?= unistd.h | 42 | unistd-${ARCH} ?= uapi/asm/unistd.h |
43 | 43 | ||
44 | # by default we use the local version | 44 | # by default we use the local version |
45 | LIBLITMUS ?= . | 45 | LIBLITMUS ?= . |
46 | 46 | ||
47 | # where to find header files | 47 | # where to find header files |
48 | headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include | 48 | headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include |
49 | headers += -I${LIBLITMUS}/arch/${include-${ARCH}}/include/uapi | ||
50 | headers += -I${LIBLITMUS}/arch/${include-${ARCH}}/include/generated/uapi | ||
49 | 51 | ||
50 | # combine options | 52 | # combine options |
51 | CPPFLAGS = ${flags-api} ${flags-${ARCH}} -DARCH=${ARCH} ${headers} | 53 | CPPFLAGS = ${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 |
151 | arch/${include-${ARCH}}/include/asm/%.h: \ | 153 | arch/${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 | |||
158 | arch/${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 | ||
162 | unistd-headers = \ | 169 | unistd-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 | ||
166 | imported-headers = ${litmus-headers} ${unistd-headers} | 173 | imported-headers = ${litmus-headers} ${unistd-headers} |
@@ -266,7 +273,7 @@ $(error Cannot build without access to the LITMUS^RT kernel source) | |||
266 | endif | 273 | endif |
267 | 274 | ||
268 | kernel-unistd-hdrs := $(foreach file,${unistd-headers},${LITMUS_KERNEL}/$(file)) | 275 | kernel-unistd-hdrs := $(foreach file,${unistd-headers},${LITMUS_KERNEL}/$(file)) |
269 | hdr-ok := $(shell egrep '\#include ["<]litmus/unistd' ${kernel-unistd-hdrs} ) | 276 | hdr-ok := $(shell egrep '\#include ["<]litmus/unistd|__NR_litmus_lock' ${kernel-unistd-hdrs} ) |
270 | ifeq ($(strip $(hdr-ok)),) | 277 | ifeq ($(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) |