]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/cc/cc_tools/Makefile.hdrs
Merge lld trunk r366426, and resolve conflicts.
[FreeBSD/FreeBSD.git] / gnu / usr.bin / cc / cc_tools / Makefile.hdrs
1 # $FreeBSD$
2 #
3 # This is logic for common headers shared inside of gnu/lib.  It used to
4 # live in gnu/usr.bin/cc/cc_tools/Makefile.
5
6 .if !defined(TARGET_CPUARCH) || !defined(GCC_CPU)
7 .error ${.CURDIR}: Must include gnu/usr.bin/cc/Makefile.tgt first.
8 .endif
9
10 #
11 # The list of headers to go into tm.h
12 #
13 TARGET_INC+=    options.h
14 .if ${TARGET_CPUARCH} == "amd64"
15 TARGET_INC+=    i386/biarch64.h
16 .endif
17 .if ${TARGET_CPUARCH} != "arm"
18 TARGET_INC+=    ${GCC_CPU}/${GCC_CPU}.h
19 .endif
20 .if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64"
21 TARGET_INC+=    ${GCC_CPU}/unix.h
22 TARGET_INC+=    ${GCC_CPU}/att.h
23 .endif
24 .if ${TARGET_CPUARCH} == "powerpc"
25 TARGET_INC+=    ${GCC_CPU}/secureplt.h
26 .endif
27 TARGET_INC+=    dbxelf.h
28 TARGET_INC+=    elfos-undef.h
29 TARGET_INC+=    elfos.h
30 TARGET_INC+=    freebsd-native.h
31 TARGET_INC+=    freebsd-spec.h
32 TARGET_INC+=    freebsd.h
33 .if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64"
34 . if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
35 TARGET_INC+=    ${GCC_CPU}/sysv4.h
36 . endif
37 .endif
38 .if ${TARGET_CPUARCH} == "amd64"
39 TARGET_INC+=    ${GCC_CPU}/x86-64.h
40 .endif
41 .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips"
42 TARGET_INC+=    ${GCC_CPU}/elf.h
43 .endif
44 .if ${TARGET_CPUARCH} == "arm"
45 TARGET_INC+=    ${GCC_CPU}/aout.h
46 TARGET_INC+=    ${GCC_CPU}/bpabi.h
47 .endif
48 .if ${TARGET_ARCH} == "powerpc64"
49 TARGET_INC+=    ${GCC_CPU}/biarch64.h
50 TARGET_INC+=    ${GCC_CPU}/default64.h
51 .endif
52 .if ${TARGET_ARCH} == "powerpcspe"       
53 TARGET_INC+=    ${GCC_CPU}/freebsdspe.h          
54 TARGET_INC+=    ${GCC_CPU}/e500-double.h         
55 .endif
56 TARGET_INC+=    ${GCC_CPU}/freebsd.h
57 .if ${TARGET_CPUARCH} == "amd64"
58 TARGET_INC+=    ${GCC_CPU}/freebsd64.h
59 .endif
60 .if ${TARGET_CPUARCH} == "arm"
61 TARGET_INC+=    ${GCC_CPU}/arm.h
62 .endif
63 TARGET_INC+=    defaults.h
64
65 #
66 # Option files.
67 #
68 OPT_FILES=      c.opt common.opt
69
70 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt)
71 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
72 .endif
73
74 .if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt)
75 OPT_FILES+=     ${.CURDIR}/${GCC_CPU}-freebsd.opt
76 .endif
77
78 .if ${TARGET_CPUARCH} == "powerpc"
79 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
80 .endif
81
82 .if ${TARGET_CPUARCH} == "sparc64"
83 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
84 .endif
85
86 .if exists(${.CURDIR}/freebsd.opt)
87 OPT_FILES+=     ${.CURDIR}/freebsd.opt
88 .endif
89
90
91 # Options
92 optionlist: ${OPT_FILES}
93         LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
94
95 options.h:      optionlist
96         LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
97             -f ${GCCDIR}/opth-gen.awk \
98                 < ${.ALLSRC} > ${.TARGET}
99
100 options.c:      optionlist
101         LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
102             -f ${GCCDIR}/optc-gen.awk \
103                 -v header_name="config.h system.h coretypes.h tm.h" \
104                 < ${.ALLSRC} > ${.TARGET}
105
106 # Target machine config
107 tm.h:
108         TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
109         HEADERS="${TARGET_INC}" \
110         DEFINES="" \
111         /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
112 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
113         echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
114 .endif
115
116 # tconfig.h
117 tconfig.h:
118         TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
119         HEADERS="auto-host.h ansidecl.h" \
120         DEFINES="USED_FOR_TARGET" \
121         /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
122
123 # Version header for gcov
124 gcov-iov.h:
125         echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET}
126
127 # Linked headers
128 gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA
129         ln -sf ${.ALLSRC} ${.TARGET}
130
131 .if ${TARGET_CPUARCH} == "arm"
132 unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
133 .else
134 unwind.h: ${GCCDIR}/unwind-generic.h
135 .endif
136
137 unwind.h: .NOMETA
138         ln -sf ${.ALLSRC} ${.TARGET}
139