Index: head/gnu/lib/csu/Makefile =================================================================== --- head/gnu/lib/csu/Makefile (revision 298217) +++ head/gnu/lib/csu/Makefile (revision 298218) @@ -1,77 +1,77 @@ # $FreeBSD$ .include MK_SSP= no GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs CCDIR= ${.CURDIR}/../../usr.bin/cc .include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} -SRCS= crtstuff.c tconfig.h tm.h options.h +SRCS= crtstuff.c ${COMMONHDRS} OBJS= crtbegin.o crtend.o crtbeginT.o SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder CFLAGS+= -fno-inline-functions -fno-exceptions \ -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \ -fno-omit-frame-pointer CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \ -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif .if ${MACHINE_CPUARCH} == "powerpc" TGTOBJS= crtsavres.o SRCS+= crtsavres.asm .endif .if ${MACHINE_CPUARCH} == "sparc64" TGTOBJS= crtfastmath.o SRCS+= crtfastmath.c .endif BEGINSRC?= crtstuff.c ENDSRC?= crtstuff.c FILES= ${OBJS} ${SOBJS} ${TGTOBJS} FILESMODE= ${LIBMODE} FILESOWN= ${LIBOWN} FILESGRP= ${LIBGRP} FILESDIR= ${LIBDIR} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY ${OBJS} ${SOBJS}: ${SRCS:M*.h} CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS} crtbegin.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \ -c -o ${.TARGET} ${.ALLSRC:N*.h} crtbeginT.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \ -c -o ${.TARGET} ${.ALLSRC:N*.h} crtbeginS.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} crtend.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END \ -c -o ${.TARGET} ${.ALLSRC:N*.h} crtendS.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} -CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) +COMMONHDRS+= tm.h tconfig.h options.h +CLEANFILES+= ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h .include Index: head/gnu/lib/libgcc/Makefile =================================================================== --- head/gnu/lib/libgcc/Makefile (revision 298217) +++ head/gnu/lib/libgcc/Makefile (revision 298218) @@ -1,413 +1,408 @@ # $FreeBSD$ PACKAGE= clibs GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt UNWINDINCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include UNWINDSRCDIR= ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib .include # # libgcc is linked in last and thus cannot depend on ssp symbols coming # from earlier libraries. Disable stack protection for this library. # MK_SSP= no -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR} CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -DHAVE_GTHR_DEFAULT \ -I${GCCLIB}/include \ -I${GCCDIR}/config -I${GCCDIR} -I. \ - -I${.CURDIR}/../../usr.bin/cc/cc_tools + -I${CCDIR}/cc_tools LDFLAGS+= -nodefaultlibs LIBADD+= c SOBJS= # added to below in various ways depending on TARGET_CPUARCH #--------------------------------------------------------------------------- # # Library members defined in libgcc2.c. # When upgrading GCC, obtain the following list from mklibgcc.in # LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \ _cmpdi2 _ucmpdi2 \ _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \ _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors \ _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \ _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \ _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 \ _divxc3 _divtc3 _bswapsi2 _bswapdi2 .if ${COMPILER_TYPE} != "clang" || ${TARGET_CPUARCH} != "arm" LIB2FUNCS+= _clear_cache .endif # The floating-point conversion routines that involve a single-word integer. .for mode in sf df xf LIB2FUNCS+= _fixuns${mode}si .endfor # Likewise double-word routines. .if ${TARGET_CPUARCH} != "aarch64" && ${TARGET_CPUARCH} != "arm" && \ ${TARGET_CPUARCH} != "riscv64" # These are implemented in an ARM specific file but will not be filtered out. # RISCVTODO: can't compile .for mode in sf df xf tf LIB2FUNCS+= _fix${mode}di _fixuns${mode}di LIB2FUNCS+= _floatdi${mode} _floatundi${mode} .endfor .endif LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) # Additional sources to handle exceptions; overridden by targets as needed. .if ${MK_LLVM_LIBUNWIND} != "no" .PATH: ${COMPILERRTDIR}/lib/builtins .PATH: ${UNWINDSRCDIR} LIB2ADDEH = gcc_personality_v0.c \ int_util.c \ Unwind-EHABI.cpp \ Unwind-sjlj.c \ UnwindLevel1-gcc-ext.c \ UnwindLevel1.c \ UnwindRegistersRestore.S \ UnwindRegistersSave.S \ libunwind.cpp CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif CXXFLAGS+= -fno-rtti STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC .else # MK_LLVM_LIBUNWIND .if ${TARGET_CPUARCH} == "arm" LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c .else LIB2ADDEH = unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c gthr-gnat.c \ unwind-c.c .endif .endif # MK_LLVM_LIBUNWIND LIB2ADDEHSTATIC = $(LIB2ADDEH) LIB2ADDEHSHARED = $(LIB2ADDEH) # List of extra C and assembler files to add to static and shared libgcc2. # Assembler files should have names ending in `.asm'. LIB2FUNCS_EXTRA = # List of extra C and assembler files to add to static libgcc2. # Assembler files should have names ending in `.asm'. LIB2FUNCS_STATIC_EXTRA = # Defined in libgcc2.c, included only in the static library. # KAN: Excluded _sf_to_tf and _df_to_tf as TPBIT_FUNCS are not # built on any of our platforms. LIB2FUNCS_ST = _eprintf __gcc_bcmp FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \ _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \ _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \ _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \ _df_to_sf _thenan_df _df_to_usi _usi_to_df TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \ _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \ _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \ _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf # These might cause a divide overflow trap and so are compiled with # unwinder info. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 #----------------------------------------------------------------------- # # Platform specific bits. # When upgrading GCC, get the following definitions from config//t-* # .if ${TARGET_CPUARCH} == "arm" # from config/arm/t-strongarm-elf CFLAGS+= -Dinhibit_libc -fno-inline CFLAGS.clang+= -fheinous-gnu-extensions LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func # Some compilers generate __aeabi_ functions libgcc_s is missing LIBADD+= compiler_rt .endif .if ${TARGET_CPUARCH} == mips LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c # ABIs other than o32 need this .if ${TARGET_ARCH} != "mips" && ${TARGET_ARCH} != "mipsel" LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c .endif .endif .if ${TARGET_ARCH} == "powerpc" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm LIB2FUNCS_STATIC_EXTRA = eabi.asm .endif .if ${TARGET_ARCH} == "powerpc64" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm .endif .if ${TARGET_CPUARCH} == "sparc64" # from config/sparc/t-elf LIB1ASMSRC = lb1spc.asm LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 .endif #----------------------------------------------------------------------- # Remove any objects from LIB2FUNCS and LIB2_DIVMOD_FUNCS that are # defined as optimized assembly code in LIB1ASMFUNCS. .if defined(LIB1ASMFUNCS) .for sym in ${LIB1ASMFUNCS} LIB2FUNCS:= ${LIB2FUNCS:S/${sym}//g} LIB2_DIVMOD_FUNCS:= ${LIB2_DIVMOD_FUNCS:S/${sym}//g} .endfor .endif COMMONHDRS= tm.h tconfig.h options.h gthr-default.h .if ${MK_LLVM_LIBUNWIND} != "no" # unwind.h is a generated file when MK_LLVM_LIBUNWIND == "no", and a stale # copy may be left behind in OBJDIR when switching, so remove it explicitly. beforebuild: @rm -f ${.OBJDIR}/unwind.h .else COMMONHDRS+= unwind.h .endif #----------------------------------------------------------------------- # # Helpful shortcuts for compiler invocations. # HIDE = -fvisibility=hidden -DHIDE_EXPORTS CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC CC_S = ${CC} -c ${CFLAGS} ${SHARED_CFLAGS} ${PICFLAG} -DSHARED #----------------------------------------------------------------------- # # Functions from libgcc2.c # STD_CFLAGS = DIV_CFLAGS = -fexceptions -fnon-call-exceptions STD_FUNCS = ${LIB2FUNCS} DIV_FUNCS = ${LIB2_DIVMOD_FUNCS} STD_CFILE = libgcc2.c DIV_CFILE = libgcc2.c OBJ_GRPS = STD DIV #----------------------------------------------------------------------- # # Floating point emulation functions # .if ${TARGET_CPUARCH} == "armNOT_YET" || \ ${TARGET_CPUARCH} == "powerpc" || ${TARGET_CPUARCH} == "sparc64" FPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -DFLOAT DPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES FPBIT_CFILE = config/fp-bit.c DPBIT_CFILE = config/fp-bit.c OBJ_GRPS += FPBIT DPBIT .endif #----------------------------------------------------------------------- # # Generic build rules for object groups defined above # .for T in ${OBJ_GRPS} ${T}_OBJS_T = ${${T}_FUNCS:S/$/.o/} ${T}_OBJS_P = ${${T}_FUNCS:S/$/.po/} ${T}_OBJS_S = ${${T}_FUNCS:S/$/.So/} SOBJS += ${${T}_FUNCS:S/$/.So/} ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS} ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} ${${T}_OBJS_P}: ${${T}_CFILE} ${COMMONHDRS} ${CC_P} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS} ${CC_S} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} .endfor #----------------------------------------------------------------------- # # Extra objects coming from separate files # .if !empty(LIB2ADD) SOBJS += ${LIB2ADD:R:S/$/.So/} .endif #----------------------------------------------------------------------- # # Objects that should be in static library only. # SYMS_ST = ${LIB2FUNCS_ST} ${LIB2ADD_ST} STAT_OBJS_T = ${SYMS_ST:S/$/.o/} STAT_OBJS_P = ${SYMS_ST:S/$/.po/} STATICOBJS = ${SYMS_ST:S/$/.o/} ${STAT_OBJS_T}: ${STD_CFILE} ${COMMONHDRS} ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} ${STAT_OBJS_P}: ${STD_CFILE} ${COMMONHDRS} ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} #----------------------------------------------------------------------- # # Assembler files. # .if defined(LIB1ASMSRC) ASM_T = ${LIB1ASMFUNCS:S/$/.o/} ASM_P = ${LIB1ASMFUNCS:S/$/.po/} ASM_S = ${LIB1ASMFUNCS:S/$/.So/} ASM_V = ${LIB1ASMFUNCS:S/$/.vis/} SOBJS += ${LIB1ASMFUNCS:S/$/.So/} ${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis ${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \ -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis} ${ASM_P}: ${LIB1ASMSRC} ${.PREFIX}.vis ${CC} -x assembler-with-cpp -p -c ${CFLAGS} -DL${.PREFIX} \ -o ${.TARGET} -include ${.PREFIX}.vis ${.ALLSRC:N*.h:N*.vis} ${ASM_S}: ${LIB1ASMSRC} ${CC} -x assembler-with-cpp -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} \ -o ${.TARGET} ${.ALLSRC:N*.h} ${ASM_V}: ${LIB1ASMSRC} ${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \ -o ${.PREFIX}.vo ${.ALLSRC:N*.h} ( ${NM} -pg ${.PREFIX}.vo | \ awk 'NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden ", $$3 }'\ ) > ${.TARGET} CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo/} .endif #----------------------------------------------------------------------- # # Exception handling / unwinding support. # EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/} EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/} EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/} EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN .if ${TARGET_CPUARCH} != "riscv64" # RISCVTODO: unwinding support SOBJS += ${EH_OBJS_S} .endif .for _src in ${LIB2ADDEHSTATIC:M*.c} ${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS} ${CC_T} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} ${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS} ${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor .for _src in ${LIB2ADDEHSHARED:M*.c} ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS} ${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor - -#----------------------------------------------------------------------- -# -# Generated headers -# -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) CLEANFILES += ${COMMONHDRS} CLEANFILES += cs-*.h option* #----------------------------------------------------------------------- # # Build symbol version map # SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk SHLIB_MKMAP_OPTS = SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver .if ${TARGET_CPUARCH} == "arm" SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver .endif VERSION_MAP = libgcc.map libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ( ${NM} -pg ${SOBJS};echo %% ; \ cat ${SHLIB_MAPFILES} \ | sed -e '/^[ ]*#/d' \ -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \ | ${CC} ${CFLAGS} -E -xassembler-with-cpp -; \ ) | awk -f ${SHLIB_MKMAP} ${SHLIB_MKMAP_OPTS} > ${.TARGET} CLEANFILES += libgcc.map #----------------------------------------------------------------------- # # Build additional static libgcc_eh[_p].a libraries. # libgcc_eh.a: ${EH_OBJS_T} @${ECHO} building static gcc_eh library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q` ${RANLIB} ${RANLIBFLAGS} ${.TARGET} _LIBS+= libgcc_eh.a .if ${MK_PROFILE} != "no" libgcc_eh_p.a: ${EH_OBJS_P} @${ECHO} building profiled gcc_eh library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q` ${RANLIB} ${RANLIBFLAGS} ${.TARGET} _LIBS+= libgcc_eh_p.a .endif _libinstall: _lib-eh-install _lib-eh-install: .if ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} libgcc_eh.a ${DESTDIR}${LIBDIR} .endif .if ${MK_PROFILE} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} libgcc_eh_p.a ${DESTDIR}${LIBDIR} .endif CLEANFILES+= libgcc_eh.a libgcc_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P} .include .SUFFIXES: .vis .vo Index: head/gnu/lib/libgcov/Makefile =================================================================== --- head/gnu/lib/libgcov/Makefile (revision 298217) +++ head/gnu/lib/libgcov/Makefile (revision 298218) @@ -1,66 +1,66 @@ # $FreeBSD$ MK_PROFILE= no MK_SSP= no .include -.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs +CCDIR= ${.CURDIR}/../../usr.bin/cc +.include "${CCDIR}/Makefile.tgt" +.include "${CCDIR}/cc_tools/Makefile.hdrs" + .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} LIB= gcov CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK -CFLAGS+= -I${.CURDIR}/../../usr.bin/cc/cc_tools \ +CFLAGS+= -I${CCDIR}/cc_tools \ -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif # # Library members defined in libgcov.c. # Defined in libgcov.c, included only in gcov library SYMS = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \ _gcov_execv _gcov_execvp _gcov_execve \ _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler OBJS= ${SYMS:S/$/.o/} OBJS_T= ${SYMS:S/$/.o/} OBJS_P= ${SYMS:S/$/.po/} OBJS_S= ${SYMS:S/$/.So/} #----------------------------------------------------------------------- # # Helpful shortcuts for compiler invocations. # CC_T = ${CC} -c ${CFLAGS} -fPIC CC_P = ${CC} -c ${CFLAGS} -p -fPIC CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h CLEANFILES+= ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist - -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY - (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}) ${OBJS} beforedepend: ${COMMONHDRS} ${OBJS_T}: libgcov.c ${CC_T} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} .if !defined(NO_PIC) ${OBJS_S}: libgcov.c ${CC_S} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} .endif .if ${MK_PROFILE} != "no" ${OBJS_P}: libgcov.c ${CC_P} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} .endif .include Index: head/gnu/usr.bin/cc/cc_tools/Makefile =================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile (revision 298217) +++ head/gnu/usr.bin/cc/cc_tools/Makefile (revision 298218) @@ -1,554 +1,444 @@ # $FreeBSD$ .include CFLAGS+= -I. .include "../Makefile.inc" +# Some of the logic needed in here is defined in Makefile.hdrs as it is shared +# with gnu/lib. +.include "Makefile.hdrs" CFLAGS+= -g CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H # Override LIBIBERTY set by Makefile.inc, We use our own for # build tools. LIBIBERTY= libiberty.a .PATH: ${GCCDIR} ${GCCLIB}/libiberty #----------------------------------------------------------------------- # Determine content of variables used by the target/host config files # # The list of headers to go into tm.h # -TARGET_INC+= options.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= i386/biarch64.h -.endif -.if ${TARGET_CPUARCH} != "arm" -TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h -.endif -.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/unix.h -TARGET_INC+= ${GCC_CPU}/att.h -.endif -TARGET_INC+= dbxelf.h -TARGET_INC+= elfos-undef.h -TARGET_INC+= elfos.h -TARGET_INC+= freebsd-native.h -TARGET_INC+= freebsd-spec.h -TARGET_INC+= freebsd.h -.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" -. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) -TARGET_INC+= ${GCC_CPU}/sysv4.h -. endif -.endif -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/x86-64.h -.endif -.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" -TARGET_INC+= ${GCC_CPU}/elf.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/aout.h -TARGET_INC+= ${GCC_CPU}/bpabi.h -.endif -.if ${TARGET_ARCH} == "powerpc64" -TARGET_INC+= ${GCC_CPU}/biarch64.h -TARGET_INC+= ${GCC_CPU}/default64.h -.endif -TARGET_INC+= ${GCC_CPU}/freebsd.h -.if ${TARGET_CPUARCH} == "amd64" -TARGET_INC+= ${GCC_CPU}/freebsd64.h -.endif -.if ${TARGET_CPUARCH} == "arm" -TARGET_INC+= ${GCC_CPU}/arm.h -.endif -TARGET_INC+= defaults.h - .for H in ${TARGET_INC} .for D in ${GCCDIR}/config ${GCCDIR} ${.CURDIR} .if exists($D/$H) TARGET_INC_FILES+= $D/$H .endif .endfor .endfor # # gtyp includes. # srcdir= ${GCCDIR} CPPLIB_H= ${GCCLIB}/libcpp/include/line-map.h \ ${GCCLIB}/libcpp/include/cpplib.h SYMTAB_H= ${GCCLIB}/libcpp/include/symtab.h CPP_ID_DATA_H= ${CPPLIB_H} ${GCCLIB}/libcpp/include/cpp-id-data.h HASHTAB_H= ${GCCLIB}/include/hashtab.h SPLAY_TREE_H= ${GCCLIB}/include/splay-tree.h out_file= ${srcdir}/config/${GCC_CPU}/${GCC_CPU}.c tm_file_list= ${TARGET_INC_FILES} host_xm_file_list= ${.CURDIR}/auto-host.h ${GCCLIB}/include/ansidecl.h GTFILES_SRCDIR= ${srcdir} # Copied unchanged from gcc/Makefile.in GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \ $(CPP_ID_DATA_H) $(host_xm_file_list) \ $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \ $(srcdir)/coverage.c $(srcdir)/rtl.h \ $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \ $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \ $(srcdir)/ipa-reference.h $(srcdir)/output.h \ $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \ $(srcdir)/c-common.h $(srcdir)/c-tree.h $(srcdir)/reload.h \ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c \ $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \ $(srcdir)/dojump.c $(srcdir)/tree-profile.c \ $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \ $(srcdir)/function.c $(srcdir)/except.h \ $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \ $(srcdir)/profile.c $(srcdir)/regclass.c \ $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \ $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \ $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \ $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \ $(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parser.c \ $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \ $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \ $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \ $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \ $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \ $(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \ $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \ $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \ $(srcdir)/tree-ssa-structalias.c \ $(srcdir)/c-pragma.h $(srcdir)/omp-low.c \ $(srcdir)/targhooks.c $(srcdir)/cgraphunit.c $(out_file) \ # The list of frontend directories to look into GTFILES_LANG_DIR_NAMES= .if ${MK_CXX} != "no" GTFILES_LANG_DIR_NAMES+= cp .endif # The list of language specific files for gengtype .for L in ${GTFILES_LANG_DIR_NAMES} c .if exists(${GCCDIR}/$L-config-lang.in) # Source the language config file L_GTFILES!= sh -c '. ${GCCDIR}/$L-config-lang.in; echo $$gtfiles' .else L_GTFILES!= sh -c '. ${GCCDIR}/$L/config-lang.in; echo $$gtfiles' .endif .for F in ${L_GTFILES} GTFILES_FILES+= $F GTFILES_LANGS+= $L .endfor .endfor GTFILES+= ${GTFILES_FILES} # # Tree definition files. # TREE_DEF_FILES= .if ${MK_CXX} != "no" TREE_DEF_FILES+= cp/cp-tree.def .endif -# -# Option files. -# -OPT_FILES= c.opt common.opt - -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt -.endif - -.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) -OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt -.endif - -.if ${TARGET_CPUARCH} == "powerpc" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt -.endif - -.if ${TARGET_CPUARCH} == "sparc64" -OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt -.endif - -.if exists(${.CURDIR}/freebsd.opt) -OPT_FILES+= ${.CURDIR}/freebsd.opt -.endif - #----------------------------------------------------------------------- # Build rules for header files and generator tools # Host config config.h: TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ HEADERS="auto-host.h ansidecl.h" \ DEFINES="" \ /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} GENSRCS+= config.h CLEANFILES+= cs-config.h # Build config bconfig.h: TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ HEADERS="auto-host.h ansidecl.h" \ DEFINES="" \ /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} .if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} .endif GENSRCS+= bconfig.h CLEANFILES+= cs-bconfig.h # tconfig.h -tconfig.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="auto-host.h ansidecl.h" \ - DEFINES="USED_FOR_TARGET" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} - GENSRCS+= tconfig.h CLEANFILES+= cs-tconfig.h # Options -optionlist: ${OPT_FILES} - LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} - -options.h: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/opth-gen.awk \ - < ${.ALLSRC} > ${.TARGET} - -options.c: optionlist - LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ - -f ${GCCDIR}/optc-gen.awk \ - -v header_name="config.h system.h coretypes.h tm.h" \ - < ${.ALLSRC} > ${.TARGET} GENONLY+= optionlist options.h options.c # Target machine config -tm.h: - TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ - HEADERS="${TARGET_INC}" \ - DEFINES="" \ - /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} -.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) - echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} -.endif - GENSRCS+= tm.h CLEANFILES+= cs-tm.h # Target machine protos/preds. tm_p.h: TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ HEADERS="${GCC_CPU}/${GCC_CPU}-protos.h tm-preds.h" \ DEFINES="" \ /bin/sh ${GCCDIR}/mkconfig.sh tm_p.h GENSRCS+= tm_p.h CLEANFILES+= cs-tm_p.h # gencheck gencheck.h: ${TREE_DEF_FILES} .for F in ${TREE_DEF_FILES} echo "#include \"$F\"" >> ${.TARGET} .endfor touch ${.TARGET} GENSRCS+= gencheck.h # Source header for gtyp generator. gtyp-gen.h: ${GTFILES} echo "/* This file is machine generated. Do not edit. */" > ${.TARGET} echo "static const char * const srcdir = " >> ${.TARGET} echo "\"$(GTFILES_SRCDIR)\";" >> ${.TARGET} echo "static const char * const lang_files[] = {" >> ${.TARGET} .for F in ${GTFILES_FILES} echo "\"$F\", " >> ${.TARGET} .endfor echo "NULL};" >> ${.TARGET} echo "static const char * const langs_for_lang_files[] = {">> ${.TARGET} .for F in ${GTFILES_LANGS} echo "\"$F\", " >> ${.TARGET} .endfor echo "NULL};" >> ${.TARGET} echo "static const char * const all_files[] = {" >> ${.TARGET} .for F in ${GTFILES} echo "\"$F\", " >> ${.TARGET} .endfor echo "NULL};" >> ${.TARGET} echo "static const char * const lang_dir_names[] = {" >> ${.TARGET} .for F in c ${GTFILES_LANG_DIR_NAMES} echo "\"$F\", " >> ${.TARGET} .endfor echo "NULL};" >> ${.TARGET} GENSRCS+= gtyp-gen.h # Version header for gcov -gcov-iov.h: - echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} - GENSRCS+= gcov-iov.h # Multilib config file multilib.h: .if ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH} == "amd64" echo 'static const char *const multilib_raw[] = { \ ". !m64 !m32;", \ "64:../lib m64 !m32;", \ "32:../lib32 !m64 m32;", NULL };' > ${.TARGET} echo 'static const char *multilib_options = "m64/m32";' >> ${.TARGET} echo 'static const char *const multilib_matches_raw[] = { \ "m64 m64;", "m32 m32;", NULL };' >> ${.TARGET} .else echo 'static const char *const multilib_raw[] = { \ ". ;", NULL };' > ${.TARGET} echo 'static const char *multilib_options = "";' >> ${.TARGET} echo 'static const char *const multilib_matches_raw[] = { \ NULL };' >> ${.TARGET} .endif echo 'static const char *multilib_extra = "";' >> ${.TARGET} echo 'static const char *const multilib_exclusions_raw[] = { \ NULL };' >> ${.TARGET} GENSRCS+= multilib.h configargs.h: echo 'static const char configuration_arguments[] =' > ${.TARGET} echo ' "FreeBSD/${TARGET_ARCH} system compiler";' >> ${.TARGET} echo 'static const char thread_model[] = "posix";' >> ${.TARGET} echo 'static const struct {' >> ${.TARGET} echo ' const char *name, *value;' >> ${.TARGET} echo '} configure_default_options[] = {' >> ${.TARGET} echo ' { "NULL", "NULL" } };' >> ${.TARGET} GENSRCS+= configargs.h # Language spec files specs.h: echo '#include "cp/lang-specs.h"' > ${.TARGET} GENSRCS+= specs.h gstdint.h: echo '#include "sys/types.h"' > ${.TARGET} echo '#include "sys/stdint.h"' >> ${.TARGET} GENSRCS+= gstdint.h # Linked headers -gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} - GENSRCS+= gthr-default.h - -.if ${TARGET_CPUARCH} == "arm" -unwind.h: ${GCCDIR}/config/arm/unwind-arm.h -.else -unwind.h: ${GCCDIR}/unwind-generic.h -.endif - -unwind.h: .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} GENSRCS+= unwind.h # # gtype gunk # gengtype-lex.c: gengtype-lex.l flex -ogengtype-lex.c ${.ALLSRC} gengtype-yacc.h: gengtype-yacc.y yacc -d -o gengtype-yacc.c ${.ALLSRC} gengtype-yacc.c: gengtype-yacc.h gengtype-yacc+%DIKED.c: gengtype-yacc.c cat ${.ALLSRC} > ${.TARGET} sed -e "s/xmalloc/malloc/g" \ -e "s/xrealloc/realloc/g" \ -e "s/malloc/xmalloc/g" \ -e "s/realloc/xrealloc/g" \ ${.ALLSRC} > ${.TARGET} GENSRCS+= gengtype-lex.c gengtype-yacc.h gengtype-yacc+%DIKED.c CLEANFILES+= gengtype-yacc.c gengtype: gengtype.o gengtype-yacc+%DIKED.o gengtype-lex.o errors.o \ ${LIBIBERTY} ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} gtype-desc.h: gengtype ./gengtype touch ${.TARGET} gtype-desc.c: gtype-desc.h GENONLY+= gtype-desc.c gtype-desc.h CLEANFILES+= gt-*.h gtype-*.h # # Generator tools. # .for F in check checksum genrtl modes gen$F: gen$F.o errors.o ${LIBIBERTY} ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} .endfor .for F in attr attrtab automata codes conditions config constants emit \ extract flags opinit output peep preds recog gen$F: gen$F.o rtl.o read-rtl.o ggc-none.o vec.o min-insn-modes.o \ gensupport.o print-rtl.o errors.o ${LIBIBERTY} ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lm .endfor gencondmd: gencondmd.o ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} # # Generated .md files. # insn-conditions.md: gencondmd ./gencondmd > ${.TARGET} GENSRCS+= insn-conditions.md # # Generated header files. # .for F in constants insn-$F.h: gen$F ${MD_FILE} ./gen$F ${MD_FILE} > ${.TARGET} GENSRCS+= insn-$F.h .endfor .for F in attr codes config flags insn-$F.h: gen$F ${MD_FILE} insn-conditions.md ./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} GENSRCS+= insn-$F.h .endfor # Header files with irregular names. genrtl.h: gengenrtl ./gengenrtl -h > ${.TARGET} GENSRCS+= genrtl.h tm-preds.h: genpreds ./genpreds -h ${MD_FILE} > ${.TARGET} GENSRCS+= tm-preds.h tm-constrs.h: genpreds ./genpreds -c ${MD_FILE} > ${.TARGET} GENSRCS+= tm-constrs.h tree-check.h: gencheck ./gencheck > ${.TARGET} GENSRCS+= tree-check.h insn-modes.h: genmodes ./genmodes -h > ${.TARGET} GENSRCS+= insn-modes.h # # Generated source files. # .for F in attrtab automata emit extract opinit output peep preds recog insn-$F.c: gen$F ${MD_FILE} insn-conditions.md ./gen$F ${MD_FILE} insn-conditions.md > ${.TARGET} GENONLY+= insn-$F.c .endfor .for F in conditions insn-$F.c: gen$F ${MD_FILE} ./gen$F ${MD_FILE} > ${.TARGET} GENSRCS+= insn-$F.c .endfor # Source files with irregular names. insn-modes.c: genmodes ./genmodes > ${.TARGET} GENONLY+= insn-modes.c min-insn-modes.c: genmodes ./genmodes -m > ${.TARGET} GENSRCS+= min-insn-modes.c genrtl.c: gengenrtl ./gengenrtl > ${.TARGET} GENONLY+= genrtl.c gencondmd.c: genconditions ${MD_FILE} ./genconditions ${MD_FILE} > ${.TARGET} GENSRCS+= gencondmd.c #----------------------------------------------------------------------- # Build tools. GNTOOLS+= genattr genattrtab genautomata gencodes gencheck genchecksum \ genconditions gencondmd genconfig genconstants genemit \ genextract genflags gengenrtl gengtype genmodes genopinit \ genoutput genpeep genpreds genrecog all: ${GNTOOLS} ${GENSRCS} ${GENONLY} beforedepend: ${GENONLY} # #----------------------------------------------------------------------- # Build 'pocket' libiberty exclusively for build tools use. LIBIBERTY_SRCS= choose-temp.c concat.c cp-demangle.c cp-demint.c cplus-dem.c \ dyn-string.c fibheap.c fopen_unlocked.c getpwd.c getruntime.c \ hashtab.c hex.c lbasename.c make-temp-file.c md5.c obstack.c \ partition.c pex-unix.c physmem.c safe-ctype.c splay-tree.c xexit.c \ xmalloc.c xmemdup.c xstrdup.c xstrerror.c LIBIBERTY_OBJS= ${LIBIBERTY_SRCS:R:S/$/.o/g} .for _src in ${LIBIBERTY_SRCS} ${_src:R:S/$/.o/}: ${_src} ${CC} -c -I ${.CURDIR}/../libiberty ${CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor ${LIBIBERTY}: ${LIBIBERTY_OBJS} @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `lorder ${LIBIBERTY_OBJS} | tsort -q` ${RANLIB} ${.TARGET} CLEANFILES+= ${LIBIBERTY} ${LIBIBERTY_OBJS} #----------------------------------------------------------------------- # Fixups. # Set OBJS the same as bsd.prog.mk would do if we defined PROG. We can't # define PROG because we have multiple programs. # SRCS= errors.c genattr.c genattrtab.c \ genautomata.c gencheck.c genchecksum.c gencodes.c \ genconditions.c genconfig.c genconstants.c genemit.c \ genextract.c genflags.c gengenrtl.c gengtype.c genmodes.c \ genopinit.c genoutput.c genpeep.c genpreds.c genrecog.c \ gensupport.c ggc-none.c print-rtl.c read-rtl.c rtl.c \ vec.c SRCS+= ${GENSRCS} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} GENOBJS+= ${GENSRCS:N*.h:R:S/$/.o/g} CLEANFILES+= ${GENSRCS} ${GENONLY} ${GENOBJS} ${GNTOOLS} #----------------------------------------------------------------------- # Manual dependencies. .if !exists(${DEPENDFILE}) .include "Makefile.dep" .endif .include # DO NOT DELETE Index: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs =================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs (nonexistent) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs (revision 298218) @@ -0,0 +1,132 @@ +# $FreeBSD$ +# +# This is logic for common headers shared inside of gnu/lib. It used to +# live in gnu/usr.bin/cc/cc_tools/Makefile. + +.if !defined(TARGET_CPUARCH) || !defined(GCC_CPU) +.error ${.CURDIR}: Must include gnu/usr.bin/cc/Makefile.tgt first. +.endif + +# +# The list of headers to go into tm.h +# +TARGET_INC+= options.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= i386/biarch64.h +.endif +.if ${TARGET_CPUARCH} != "arm" +TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h +.endif +.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/unix.h +TARGET_INC+= ${GCC_CPU}/att.h +.endif +TARGET_INC+= dbxelf.h +TARGET_INC+= elfos-undef.h +TARGET_INC+= elfos.h +TARGET_INC+= freebsd-native.h +TARGET_INC+= freebsd-spec.h +TARGET_INC+= freebsd.h +.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" +. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) +TARGET_INC+= ${GCC_CPU}/sysv4.h +. endif +.endif +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/x86-64.h +.endif +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" +TARGET_INC+= ${GCC_CPU}/elf.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/aout.h +TARGET_INC+= ${GCC_CPU}/bpabi.h +.endif +.if ${TARGET_ARCH} == "powerpc64" +TARGET_INC+= ${GCC_CPU}/biarch64.h +TARGET_INC+= ${GCC_CPU}/default64.h +.endif +TARGET_INC+= ${GCC_CPU}/freebsd.h +.if ${TARGET_CPUARCH} == "amd64" +TARGET_INC+= ${GCC_CPU}/freebsd64.h +.endif +.if ${TARGET_CPUARCH} == "arm" +TARGET_INC+= ${GCC_CPU}/arm.h +.endif +TARGET_INC+= defaults.h + +# +# Option files. +# +OPT_FILES= c.opt common.opt + +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt) +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt +.endif + +.if exists(${.CURDIR}/${GCC_CPU}-freebsd.opt) +OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt +.endif + +.if ${TARGET_CPUARCH} == "powerpc" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt +.endif + +.if ${TARGET_CPUARCH} == "sparc64" +OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt +.endif + +.if exists(${.CURDIR}/freebsd.opt) +OPT_FILES+= ${.CURDIR}/freebsd.opt +.endif + + +# Options +optionlist: ${OPT_FILES} + LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET} + +options.h: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/opth-gen.awk \ + < ${.ALLSRC} > ${.TARGET} + +options.c: optionlist + LC_ALL=C awk -f ${GCCDIR}/opt-functions.awk \ + -f ${GCCDIR}/optc-gen.awk \ + -v header_name="config.h system.h coretypes.h tm.h" \ + < ${.ALLSRC} > ${.TARGET} + +# Target machine config +tm.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="${TARGET_INC}" \ + DEFINES="" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} +.if exists(${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}-modes.def) + echo '#define EXTRA_MODES_FILE "${GCC_CPU}/${GCC_CPU}-modes.def"' >> ${.TARGET} +.endif + +# tconfig.h +tconfig.h: + TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \ + HEADERS="auto-host.h ansidecl.h" \ + DEFINES="USED_FOR_TARGET" \ + /bin/sh ${GCCDIR}/mkconfig.sh ${.TARGET} + +# Version header for gcov +gcov-iov.h: + echo "#define GCOV_VERSION ((gcov_unsigned_t)0x34303270)" >> ${.TARGET} + +# Linked headers +gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + +.if ${TARGET_CPUARCH} == "arm" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h +.else +unwind.h: ${GCCDIR}/unwind-generic.h +.endif + +unwind.h: .NOMETA + ln -sf ${.ALLSRC} ${.TARGET} + Property changes on: head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property