Sync usage with man page.
[netbsd-mini2440.git] / gnu / lib / crtstuff4 / Makefile
blobfb911789e84329e7d034272290ee5b07ecc564ba
1 # $NetBSD: Makefile,v 1.3 2008/08/04 04:53:22 lukem Exp $
3 REQUIRETOOLS= yes
4 NOLINT= # defined
6 .include <bsd.own.mk>
8 # If using an external toolchain, we expect crtbegin/crtend to be
9 # supplied by that toolchain's run-time support.
10 .if !defined(EXTERNAL_TOOLCHAIN) && ${MKGCC} != "no" && ${OBJECT_FMT} == "ELF"
12 DIST= ${NETBSDSRCDIR}/gnu/dist/gcc4
13 GNUHOSTDIST= ${DIST}
14 GCCARCH= ${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${MACHINE_ARCH}
16 GALLCFLAGS= ${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS}
18 CPPFLAGS+= -I${GCCARCH} ${GALLCFLAGS:M-D*} ${GALLCFLAGS:M-I*:N-I.*}
19 CPPFLAGS+= -I.
21 GCFLAGS= ${GALLCFLAGS:N-D*:N-I*:N-i*:N./*}
23 DPSRCS+= ${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h
24 CLEANFILES+= cs-tconfig.h tconfig.h
26 .include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
28 SRCS+= crtbegin.c crtend.c
29 OBJS+= crtbegin.o crtend.o
30 .if ${MKPIC} != "no"
31 SRCS+= crtbeginS.c crtendS.c
32 OBJS+= crtbeginS.o crtendS.o # for shared libraries
33 SRCS+= crtbeginT.c
34 OBJS+= crtbeginT.o # for -static links
35 .endif
37 realall: ${OBJS}
39 FILES=${OBJS}
40 FILESDIR=${LIBDIR}
42 .PATH: ${DIST}/gcc ${DIST}/gcc/config ${G_CONFIGDIR}
44 tconfig.h:
45 ${_MKTARGET_CREATE}
46 TM_DEFINES="$(G_tm_defines)" \
47 HEADERS="$(G_xm_file)" XM_DEFINES="$(G_xm_defines)" \
48 TARGET_CPU_DEFAULT="" \
49 ${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
51 # these aren't necessary but are #include'd
52 FAKEHEADERS=options.h insn-flags.h insn-constants.h
53 ${FAKEHEADERS}:
54 ${_MKTARGET_CREATE}
55 touch ${.TARGET}
56 DPSRCS+= ${FAKEHEADERS}
57 CLEANFILES+= ${FAKEHEADERS}
59 ${OBJS}: ${DPSRCS}
61 .include <bsd.prog.mk>
63 # Override the default .c -> .o rule.
64 .c.o:
65 ${_MKTARGET_COMPILE}
66 ${CC} ${CPPFLAGS} ${GCFLAGS} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
67 mv ${.TARGET}.o ${.TARGET}
69 .if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
70 # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
71 # and GCC configury passes -finhibit-size-directive which causes mips-gas
72 # to barf. Don't know what the real fix for this is...
74 # XXX should be COPTS, but that's too early
75 CPUFLAGS+=-Wa,--no-warn
76 .endif
78 .else
80 .include <bsd.prog.mk> # do nothing
82 .endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no && OBJECT_FMT == ELF