Accept elf files that are valid but have sections that can not be mmap'ed for some...
[deliverable/linux.git] / Documentation / lguest / Makefile
CommitLineData
8ca47e00
RR
1# This creates the demonstration utility "lguest" which runs a Linux guest.
2
3# For those people that have a separate object dir, look there for .config
4KBUILD_OUTPUT := ../..
5ifdef O
6 ifeq ("$(origin O)", "command line")
7 KBUILD_OUTPUT := $(O)
8 endif
9endif
10# We rely on CONFIG_PAGE_OFFSET to know where to put lguest binary.
11include $(KBUILD_OUTPUT)/.config
12LGUEST_GUEST_TOP := ($(CONFIG_PAGE_OFFSET) - 0x08000000)
13
b45d8cb0 14CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -Wl,-T,lguest.lds
8ca47e00 15LDLIBS:=-lz
e3bcf5e2
RM
16# Removing this works for some versions of ld.so (eg. Ubuntu Feisty) and
17# not others (eg. FC7).
18LDFLAGS+=-static
8ca47e00
RR
19all: lguest.lds lguest
20
21# The linker script on x86 is so complex the only way of creating one
22# which will link our binary in the right place is to mangle the
23# default one.
24lguest.lds:
25 $(LD) --verbose | awk '/^==========/ { PRINT=1; next; } /SIZEOF_HEADERS/ { gsub(/0x[0-9A-F]*/, "$(LGUEST_GUEST_TOP)") } { if (PRINT) print $$0; }' > $@
26
27clean:
28 rm -f lguest.lds lguest
This page took 0.061214 seconds and 5 git commands to generate.