blob: 51ead52141bd083774ed3ed13d8c71dc831f0f23 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2# List of files in the vdso, has to be asm only for now
3
Benjamin Herrenschmidt1b29f9d2005-05-01 08:58:43 -07004obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6# Build rules
7
Benjamin Herrenschmidta7f290d2005-11-11 21:15:21 +11008ifeq ($(CONFIG_PPC32),y)
9CROSS32CC := $(CC)
10endif
11
Roland McGrath8150caa2007-10-02 13:30:04 -070012targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
Linus Torvalds1da177e2005-04-16 15:20:36 -070013obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
14
Michael Ellermana15098c2009-08-09 19:02:51 +000015GCOV_PROFILE := n
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Roland McGrath8150caa2007-10-02 13:30:04 -070017EXTRA_CFLAGS := -shared -fno-common -fno-builtin
Roland McGrath0b0bf7a2006-07-30 03:04:06 -070018EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
Sam Ravnborgf86fd302009-09-19 10:14:33 +020019 $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
Linus Torvalds1da177e2005-04-16 15:20:36 -070020EXTRA_AFLAGS := -D__VDSO32__ -s
21
22obj-y += vdso32_wrapper.o
23extra-y += vdso32.lds
Paul Mackerras271c3f32005-11-11 23:04:40 +110024CPPFLAGS_vdso32.lds += -P -C -Upowerpc
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26# Force dependency (incbin is bad)
27$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
28
29# link rule for the .so file, .lds has to be first
Roland McGrath8150caa2007-10-02 13:30:04 -070030$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 $(call if_changed,vdso32ld)
32
Roland McGrath8150caa2007-10-02 13:30:04 -070033# strip rule for the .so file
34$(obj)/%.so: OBJCOPYFLAGS := -S
35$(obj)/%.so: $(obj)/%.so.dbg FORCE
36 $(call if_changed,objcopy)
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038# assembly rules for the .S files
39$(obj-vdso32): %.o: %.S
40 $(call if_changed_dep,vdso32as)
41
42# actual build commands
43quiet_cmd_vdso32ld = VDSO32L $@
44 cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $^ -o $@
45quiet_cmd_vdso32as = VDSO32A $@
46 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
47
Roland McGrath8150caa2007-10-02 13:30:04 -070048# install commands for the unstripped file
49quiet_cmd_vdso_install = INSTALL $@
50 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
51
52vdso32.so: $(obj)/vdso32.so.dbg
53 @mkdir -p $(MODLIB)/vdso
54 $(call cmd,vdso_install)
55
56vdso_install: vdso32.so