]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/cc/cc_tools/Makefile.hdrs
MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
[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 TARGET_INC+=    dbxelf.h
25 TARGET_INC+=    elfos-undef.h
26 TARGET_INC+=    elfos.h
27 TARGET_INC+=    freebsd-native.h
28 TARGET_INC+=    freebsd-spec.h
29 TARGET_INC+=    freebsd.h
30 .if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64"
31 . if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
32 TARGET_INC+=    ${GCC_CPU}/sysv4.h
33 . endif
34 .endif
35 .if ${TARGET_CPUARCH} == "amd64"
36 TARGET_INC+=    ${GCC_CPU}/x86-64.h
37 .endif
38 .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips"
39 TARGET_INC+=    ${GCC_CPU}/elf.h
40 .endif
41 .if ${TARGET_CPUARCH} == "arm"
42 TARGET_INC+=    ${GCC_CPU}/aout.h
43 TARGET_INC+=    ${GCC_CPU}/bpabi.h
44 .endif
45 .if ${TARGET_ARCH} == "powerpc64"
46 TARGET_INC+=    ${GCC_CPU}/biarch64.h
47 TARGET_INC+=    ${GCC_CPU}/default64.h
48 .endif
49 .if ${TARGET_ARCH} == "powerpcspe"       
50 TARGET_INC+=    ${GCC_CPU}/freebsdspe.h          
51 TARGET_INC+=    ${GCC_CPU}/e500-double.h         
52 .endif
53 TARGET_INC+=    ${GCC_CPU}/freebsd.h
54 .if ${TARGET_CPUARCH} == "amd64"
55 TARGET_INC+=    ${GCC_CPU}/freebsd64.h
56 .endif
57 .if ${TARGET_CPUARCH} == "arm"
58 TARGET_INC+=    ${GCC_CPU}/arm.h
59 .endif
60 TARGET_INC+=    defaults.h
61
62 #
63 # Option files.
64 #
65 OPT_FILES=      c.opt common.opt
66
67 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt)
68 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
69 .endif
70
71 .if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt)
72 OPT_FILES+=     ${.CURDIR}/${GCC_CPU}-freebsd.opt
73 .endif
74
75 .if ${TARGET_CPUARCH} == "powerpc"
76 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
77 .endif
78
79 .if ${TARGET_CPUARCH} == "sparc64"
80 OPT_FILES+=     ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
81 .endif
82
83 .if exists(${.CURDIR}/freebsd.opt)
84 OPT_FILES+=     ${.CURDIR}/freebsd.opt
85 .endif
86
87
88 # Options
89 optionlist: ${OPT_FILES}
90         LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
91
92 options.h:      optionlist
93         LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
94             -f ${GCCDIR}/opth-gen.awk \
95                 < ${.ALLSRC} > ${.TARGET}
96
97 options.c:      optionlist
98         LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
99             -f ${GCCDIR}/optc-gen.awk \
100                 -v header_name="config.h system.h coretypes.h tm.h" \
101                 < ${.ALLSRC} > ${.TARGET}
102
103 # Target machine config
104 tm.h:
105         TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
106         HEADERS="${TARGET_INC}" \
107         DEFINES="" \
108         /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
109 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
110         echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
111 .endif
112
113 # tconfig.h
114 tconfig.h:
115         TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
116         HEADERS="auto-host.h ansidecl.h" \
117         DEFINES="USED_FOR_TARGET" \
118         /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
119
120 # Version header for gcov
121 gcov-iov.h:
122         echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET}
123
124 # Linked headers
125 gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA
126         ln -sf ${.ALLSRC} ${.TARGET}
127
128 .if ${TARGET_CPUARCH} == "arm"
129 unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
130 .else
131 unwind.h: ${GCCDIR}/unwind-generic.h
132 .endif
133
134 unwind.h: .NOMETA
135         ln -sf ${.ALLSRC} ${.TARGET}
136