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.
6 .if !defined(TARGET_CPUARCH) || !defined(GCC_CPU)
7 .error ${.CURDIR}: Must include gnu/usr.bin/cc/Makefile.tgt first.
11 # The list of headers to go into tm.h
13 TARGET_INC+= options.h
14 .if ${TARGET_CPUARCH} == "amd64"
15 TARGET_INC+= i386/biarch64.h
17 .if ${TARGET_CPUARCH} != "arm"
18 TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h
20 .if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64"
21 TARGET_INC+= ${GCC_CPU}/unix.h
22 TARGET_INC+= ${GCC_CPU}/att.h
25 TARGET_INC+= elfos-undef.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
35 .if ${TARGET_CPUARCH} == "amd64"
36 TARGET_INC+= ${GCC_CPU}/x86-64.h
38 .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips"
39 TARGET_INC+= ${GCC_CPU}/elf.h
41 .if ${TARGET_CPUARCH} == "arm"
42 TARGET_INC+= ${GCC_CPU}/aout.h
43 TARGET_INC+= ${GCC_CPU}/bpabi.h
45 .if ${TARGET_ARCH} == "powerpc64"
46 TARGET_INC+= ${GCC_CPU}/biarch64.h
47 TARGET_INC+= ${GCC_CPU}/default64.h
49 TARGET_INC+= ${GCC_CPU}/freebsd.h
50 .if ${TARGET_CPUARCH} == "amd64"
51 TARGET_INC+= ${GCC_CPU}/freebsd64.h
53 .if ${TARGET_CPUARCH} == "arm"
54 TARGET_INC+= ${GCC_CPU}/arm.h
56 TARGET_INC+= defaults.h
61 OPT_FILES= c.opt common.opt
63 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt)
64 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
67 .if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt)
68 OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt
71 .if ${TARGET_CPUARCH} == "powerpc"
72 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
75 .if ${TARGET_CPUARCH} == "sparc64"
76 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
79 .if exists(${.CURDIR}/freebsd.opt)
80 OPT_FILES+= ${.CURDIR}/freebsd.opt
85 optionlist: ${OPT_FILES}
86 LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
89 LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
90 -f ${GCCDIR}/opth-gen.awk \
91 < ${.ALLSRC} > ${.TARGET}
94 LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
95 -f ${GCCDIR}/optc-gen.awk \
96 -v header_name="config.h system.h coretypes.h tm.h" \
97 < ${.ALLSRC} > ${.TARGET}
99 # Target machine config
101 TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
102 HEADERS="${TARGET_INC}" \
104 /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
105 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def)
106 echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET}
111 TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
112 HEADERS="auto-host.h ansidecl.h" \
113 DEFINES="USED_FOR_TARGET" \
114 /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET}
116 # Version header for gcov
118 echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET}
121 gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA
122 ln -sf ${.ALLSRC} ${.TARGET}
124 .if ${TARGET_CPUARCH} == "arm"
125 unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
127 unwind.h: ${GCCDIR}/unwind-generic.h
131 ln -sf ${.ALLSRC} ${.TARGET}