minix/lib/generateasm.mk

33 lines
831 B
Makefile
Raw Normal View History

2012-08-07 17:01:25 +02:00
ORIGFUNC= ${.PREFIX:S/^compat//}
RENAMEDFUNC=${.PREFIX:S/^compat__//:C/([0-9]{2})$//}
.if (${MACHINE_ARCH} == "i386")
FUNCTYPE= @function
PICJMP= jmpl *PIC_PLT(${ORIGFUNC})
JMP= jmp ${ORIGFUNC}
.elif (${MACHINE_ARCH} == "arm")
FUNCTYPE= %%function
PICJMP= bl PIC_SYM(${ORIGFUNC}, PLT)
JMP= b ${ORIGFUNC}
.endif
${ASM}:
${_MKTARGET_CREATE}
printf '/* MINIX3 */ \n\
/* \n\
* Compatibility jump table for renamed symbols. \n\
* \n\
* DO NOT EDIT: this file is automatically generated. \n\
*/ \n\
#include <machine/asm.h> \n\
2012-08-07 17:01:25 +02:00
.global ${RENAMEDFUNC}; \n\
.global ${ORIGFUNC}; \n\
.type ${RENAMEDFUNC},${FUNCTYPE} \n\
${RENAMEDFUNC}: \n\
#ifdef PIC \n\
2012-08-07 17:01:25 +02:00
${PICJMP} \n\
#else \n\
2012-08-07 17:01:25 +02:00
${JMP} \n\
#endif \n\
\n ' >${.TARGET}