Remove building with NOCRYPTO option
[minix3.git] / lib / csu / common / Makefile.inc
blob56762ce650377aa8d14ed10c6d6a60f749add619
1 #       $NetBSD: Makefile.inc,v 1.25 2014/03/04 17:57:56 joerg Exp $
3 .include <bsd.own.mk>
5 # XXX: FIXME: This is defined in bsd.lib.mk
6 PICFLAGS ?= -fPIC
8 COMMON_DIR:=    ${.CURDIR}/common
9 .PATH:          ${COMMON_DIR}
11 CPPFLAGS+=      -I${NETBSDSRCDIR}/libexec/ld.elf_so -I${COMMON_DIR} -I.
13 OBJS+=          crt0.o gcrt0.o crti.o crtn.o
14 OBJS+=          crtbegin.o crtend.o
16 .if ${MKPIC} == "yes"
17 OBJS+=          crtbeginS.o
18 CFLAGS.crtbegin.c+= -fPIE
19 .endif
20 .if ${MACHINE_ARCH} == "alpha"
21 OBJS+=          crtfm.o
22 .endif
24 .if ${CSU_MACHINE_ARCH} == "sparc64"
25 # create helper objects for the compiler to mark compiler memory models
26 .for m in medlow medmid medany
27 sparc_mc${m}.o: compident.S sysident_assym.h
28         ${CC} ${ASFLAGS} -I. -DCONTENT=\"${m}\\0\\0\" -DCONTENTLENGTH=8 -c \
29                 -o $@ ${COMMON_DIR}/compident.S
30 .endfor
31 OBJS += sparc_mcmedlow.o sparc_mcmedmid.o sparc_mcmedany.o
32 .endif
34 realall: ${OBJS}
36 .if exists(${ARCHDIR}/crtbegin.S)
37 crtbegin.o: crtbegin.S
38         ${_MKTARGET_COMPILE}
39         ${COMPILE.S} ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
40 .else
41 crtbegin.o: crtbegin.c crtbegin.h
42         ${_MKTARGET_COMPILE}
43         ${COMPILE.c} ${CFLAGS.crtbegin.c} ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
44 .endif
45         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
46         rm -f ${.TARGET}.o
47 .if ${MKSTRIPIDENT} != "no"
48         ${OBJCOPY} -R .ident ${.TARGET}
49 .endif
51 .if exists(${ARCHDIR}/crtbegin.S)
52 crtbeginS.o: crtbegin.S
53         ${_MKTARGET_COMPILE}
54         ${COMPILE.S} ${PICFLAGS} -DSHARED ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
55 .else
56 crtbeginS.o: crtbegin.c crtbegin.h
57         ${_MKTARGET_COMPILE}
58         ${COMPILE.c} ${PICFLAGS} -DSHARED ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
59 .endif
60         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
61         rm -f ${.TARGET}.o
62 .if ${MKSTRIPIDENT} != "no"
63         ${OBJCOPY} -R .ident ${.TARGET}
64 .endif
66 crtend.o: crtend.S
67         ${_MKTARGET_COMPILE}
68         ${COMPILE.S} ${ARCHDIR}/crtend.S -o ${.TARGET}.o
69         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
70         rm -f ${.TARGET}.o
71 .if ${MKSTRIPIDENT} != "no"
72         ${OBJCOPY} -R .ident ${.TARGET}
73 .endif
75 .if ${MKPIC} != "no"
76 MY_PICFLAGS=    ${PICFLAGS}
77 .else
78 MY_PICFLAGS=
79 .endif
81 crt0.o: crt0.S crt0-common.c
82         ${_MKTARGET_COMPILE}
83         ${COMPILE.S} ${ARCHDIR}/crt0.S -o ${.TARGET}.S.o
84         ${COMPILE.c} ${MY_PICFLAGS} ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
85         ${LD} -r -o ${.TARGET}.o ${.TARGET}.S.o ${.TARGET}.c.o
86         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
87         rm -f ${.TARGET}.S.o ${.TARGET}.c.o ${.TARGET}.o
88 .if ${MKSTRIPIDENT} != "no"
89         ${OBJCOPY} -R .ident ${.TARGET}
90 .endif
92 gcrt0.o: crt0.S crt0-common.c
93         ${_MKTARGET_COMPILE}
94         ${COMPILE.S} ${ARCHDIR}/crt0.S -o ${.TARGET}.S.o
95         ${COMPILE.c} ${MY_PICFLAGS} -DMCRT0 ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
96         ${LD} -r -o ${.TARGET}.o ${.TARGET}.S.o ${.TARGET}.c.o
97         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
98         rm -f ${.TARGET}.S.o ${.TARGET}.c.o ${.TARGET}.o
99 .if ${MKSTRIPIDENT} != "no"
100         ${OBJCOPY} -R .ident ${.TARGET}
101 .endif
103 .if ${MACHINE_ARCH} == "alpha"
104 # can't do this in Makefile.inc otherwise it will before realall:
105 crtfm.o: crtfm.c
106         ${_MKTARGET_COMPILE}
107         ${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o
108         ${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
109         rm -f ${.TARGET}.o
110 .endif
112 GENASSYM_CONF=  ${COMMON_DIR}/sysident_assym.cf 
113 sysident_assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS} ${NETBSDSRCDIR}/sys/sys/param.h
114         ${_MKTARGET_CREATE}
115         cat ${COMMON_DIR}/sysident_assym.cf | \
116             ${TOOL_GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
117             ${GENASSYM_CPPFLAGS} > sysident_assym.h.tmp && \
118         mv -f sysident_assym.h.tmp sysident_assym.h
120 CLEANFILES+=    sysident_assym.h
122 crti.o: crti.S sysident_assym.h sysident.S
123 crtn.o: crtn.S
125 FILES=${OBJS}
126 FILESDIR=${LIBDIR}
127 CLEANFILES+=${OBJS}
129 .if ${MKPIC} == "yes"
130 SYMLINKS+=      crtbegin.o ${LIBDIR}/crtbeginT.o
131 SYMLINKS+=      crtend.o ${LIBDIR}/crtendS.o
132 .endif
134 .include <bsd.prog.mk>