32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
# Tup rules that are local to this Git repo and
|
|
# should not be shared with other projects.
|
|
|
|
&LD_SCRIPT_SO = base/src/ld/genode_rel.ld
|
|
|
|
ifeq (@(TUP_ARCH),x86_64)
|
|
ASM_SYM_DEPENDENCY = movq \1@GOTPCREL(%rip), %rax
|
|
else
|
|
ASM_SYM_DEPENDENCY = .long \1
|
|
endif
|
|
|
|
!abi_stub = |> ^ STUB %o^\
|
|
sed \
|
|
-e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%%object; \1:/" \
|
|
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%%function; \1:/" \
|
|
-e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/" \
|
|
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
|
|
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/" \
|
|
%f \
|
|
| $(CC) -x assembler -c - -o tmp.o; \
|
|
$(LD) -o %o \
|
|
-shared \
|
|
-T &(LD_SCRIPT_SO) \
|
|
tmp.o; \
|
|
rm tmp.o; \
|
|
|> $(DEV_LIB_DIR)/%B.lib.so $(DEV_DIR)/<lib>
|
|
|
|
BASE_DIR = $(GENODE_DIR)/repos/base
|
|
&BASE_DIR = base
|