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 .if ${TARGET_ARCH} == "powerpcspe"
50 TARGET_INC+= ${GCC_CPU}/freebsdspe.h
51 TARGET_INC+= ${GCC_CPU}/e500-double.h
53 TARGET_INC+= ${GCC_CPU}/freebsd.h
54 .if ${TARGET_CPUARCH} == "amd64"
55 TARGET_INC+= ${GCC_CPU}/freebsd64.h
57 .if ${TARGET_CPUARCH} == "arm"
58 TARGET_INC+= ${GCC_CPU}/arm.h
60 TARGET_INC+= defaults.h
65 OPT_FILES= c.opt common.opt
67 .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt)
68 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
71 .if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt)
72 OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt
75 .if ${TARGET_CPUARCH} == "powerpc"
76 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
79 .if ${TARGET_CPUARCH} == "sparc64"
80 OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
83 .if exists(${.CURDIR}/freebsd.opt)
84 OPT_FILES+= ${.CURDIR}/freebsd.opt
89 optionlist: ${OPT_FILES}
90 LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
93 LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \
94 -f ${GCCDIR}/opth-gen.awk \
95 < ${.ALLSRC} > ${.TARGET}
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}
103 # Target machine config
105 TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
106 HEADERS="${TARGET_INC}" \
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}
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}
120 # Version header for gcov
122 echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET}
125 gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA
126 ln -sf ${.ALLSRC} ${.TARGET}
128 .if ${TARGET_CPUARCH} == "arm"
129 unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
131 unwind.h: ${GCCDIR}/unwind-generic.h
135 ln -sf ${.ALLSRC} ${.TARGET}