Merge branch 'nvme-5.2-rc2' of git://git.infradead.org/nvme into for-linus
[linux-2.6-microblaze.git] / arch / nds32 / kernel / vdso / Makefile
1 #
2 # Building a vDSO image for AArch64.
3 #
4 # Author: Will Deacon <will.deacon@arm.com>
5 # Heavily based on the vDSO Makefiles for other archs.
6 #
7
8 obj-vdso := note.o datapage.o sigreturn.o gettimeofday.o
9
10 # Build rules
11 targets := $(obj-vdso) vdso.so vdso.so.dbg
12 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
13
14 ccflags-y := -shared -fno-common -fno-builtin -nostdlib -fPIC -Wl,-shared -g \
15         -Wl,-soname=linux-vdso.so.1 -Wl,--hash-style=sysv
16
17 # Disable gcov profiling for VDSO code
18 GCOV_PROFILE := n
19
20
21 obj-y += vdso.o
22 extra-y += vdso.lds
23 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
24
25 # Force dependency
26 $(obj)/vdso.o : $(obj)/vdso.so
27
28 # Link rule for the .so file, .lds has to be first
29 $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
30         $(call if_changed,vdsold)
31
32
33 # Strip rule for the .so file
34 $(obj)/%.so: OBJCOPYFLAGS := -S
35 $(obj)/%.so: $(obj)/%.so.dbg FORCE
36         $(call if_changed,objcopy)
37
38 # Generate VDSO offsets using helper script
39 gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
40 quiet_cmd_vdsosym = VDSOSYM $@
41       cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
42
43 include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
44         $(call if_changed,vdsosym)
45
46
47
48 # Assembly rules for the .S files
49
50 sigreturn.o : sigreturn.S
51         $(call if_changed_dep,vdsoas)
52
53 note.o : note.S
54         $(call if_changed_dep,vdsoas)
55
56 datapage.o : datapage.S
57         $(call if_changed_dep,vdsoas)
58
59 gettimeofday.o : gettimeofday.c FORCE
60         $(call if_changed_dep,vdsocc)
61
62 # Actual build commands
63 quiet_cmd_vdsold = VDSOL   $@
64       cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $(real-prereqs) -o $@
65 quiet_cmd_vdsoas = VDSOA   $@
66       cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
67 quiet_cmd_vdsocc = VDSOA   $@
68       cmd_vdsocc = $(CC) $(c_flags) -c -o $@ $<
69
70 # Install commands for the unstripped file
71 quiet_cmd_vdso_install = INSTALL $@
72       cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
73
74 vdso.so: $(obj)/vdso.so.dbg
75         @mkdir -p $(MODLIB)/vdso
76         $(call cmd,vdso_install)
77
78 vdso_install: vdso.so