Home | History | Annotate | Line # | Download | only in gdb
Makefile revision 1.19
      1  1.19  christos #	$NetBSD: Makefile,v 1.19 2011/09/26 02:36:19 christos Exp $
      2   1.1        cl 
      3   1.1        cl .include <bsd.own.mk>
      4   1.1        cl 
      5  1.19  christos MODULE=		gdb
      6  1.19  christos GNUHOSTDIST=    ${.CURDIR}/../../external/gpl3/gdb/dist
      7   1.1        cl 
      8   1.1        cl FIND_ARGS=	\! \( -type d -name sim -prune \)
      9   1.1        cl 
     10   1.1        cl CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
     11   1.1        cl 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
     12   1.1        cl 
     13   1.1        cl MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
     14   1.1        cl 
     15   1.1        cl ALL_TARGET=	all-gdb
     16   1.1        cl INSTALL_TARGET=	install-gdb
     17   1.1        cl 
     18   1.1        cl .include "${.CURDIR}/../Makefile.gnuhost"
     19   1.1        cl 
     20  1.19  christos .if ${HAVE_GCC} >= 45
     21  1.19  christos CCADDFLAGS=	--sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
     22  1.19  christos .else
     23  1.19  christos CCADDFLAGS=	${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
     24  1.19  christos .endif
     25   1.2   nathanw 
     26   1.2   nathanw NEWCONFIGDIR?=	${.CURDIR}/../..
     27   1.2   nathanw MKNATIVE?=	${.CURDIR}/mknative-gdb
     28   1.2   nathanw 
     29   1.7       uwe # Some configure tests require running a test program, which is not
     30   1.7       uwe # possible when cross-building.  Provide configure with "cached"
     31   1.7       uwe # values in the environment.
     32   1.7       uwe MKNATIVE_CONFIGURE_PRESET= \
     33   1.7       uwe 	ac_cv_prog_cc_cross=yes \
     34   1.7       uwe 	ac_cv_func_fork_works=yes \
     35   1.7       uwe 	ac_cv_func_strcoll_works=yes \
     36   1.7       uwe 	bash_cv_func_ctype_nonascii=yes \
     37   1.7       uwe 	bash_cv_func_sigsetjmp=present \
     38   1.7       uwe 	bash_cv_func_strcoll_broken=no \
     39   1.7       uwe 	bash_cv_must_reinstall_sighandlers=no
     40   1.7       uwe 
     41  1.17      hans # Recent versions of Solaris have ncurses, but they hide the lib in an
     42  1.17      hans # odd directory. Prevent configure from finding the ncurses headers,
     43  1.17      hans # Solaris curses is sufficient.
     44  1.17      hans .if ${BUILD_OSTYPE} == "SunOS"
     45  1.17      hans CONFIGURE_ENV+=	ac_cv_header_ncurses_h=no \
     46  1.17      hans 		ac_cv_header_ncurses_ncurses_h=no \
     47  1.17      hans 		ac_cv_header_ncurses_term_h=no
     48  1.17      hans .endif
     49  1.17      hans 
     50   1.8       uwe # Disable sim unless it's known to work (configure's default is to
     51   1.8       uwe # enable sim if supported).
     52   1.8       uwe CONFIGURE_ARGS_SIM=
     53   1.8       uwe .if \
     54  1.11       mrg     ${MACHINE_CPU} != "mips" && \
     55   1.9     skrll     ${MACHINE_CPU} != "powerpc" && \
     56   1.8       uwe     ${MACHINE_CPU} != "powerpc64"
     57   1.8       uwe CONFIGURE_ARGS_SIM+= --disable-sim
     58   1.8       uwe .endif
     59   1.8       uwe 
     60   1.2   nathanw native-gdb: .native/.configure_done
     61   1.2   nathanw 	@echo 'Extracting GDB configury for a native toolchain.'
     62   1.2   nathanw 	MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \
     63   1.2   nathanw 		${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
     64   1.2   nathanw 
     65   1.2   nathanw .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
     66   1.3   nathanw 	mkdir ${.OBJDIR}/.native 2>/dev/null || true
     67   1.2   nathanw 	PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
     68   1.3   nathanw 		(cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \
     69   1.2   nathanw 			CC_FOR_BUILD=${HOST_CC:Q} \
     70   1.2   nathanw 			CC=${CC:Q}' '${CCADDFLAGS:Q} \
     71   1.2   nathanw 			CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
     72   1.6       uwe 			CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \
     73  1.18     njoly 			CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS=${LDADDFLAGS:Q} \
     74   1.2   nathanw 			MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
     75   1.2   nathanw 			XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
     76   1.2   nathanw 			LIBS=-lintl \
     77   1.7       uwe 			${MKNATIVE_CONFIGURE_PRESET} \
     78   1.2   nathanw 			${HOST_SH} ${GNUHOSTDIST}/configure \
     79   1.4   nathanw 			--prefix=/usr \
     80   1.5     lukem 			--with-separate-debug-dir=/usr/libdata/debug \
     81   1.8       uwe 			${CONFIGURE_ARGS_SIM} \
     82   1.2   nathanw 			--build=`${GNUHOSTDIST}/config.guess` \
     83   1.2   nathanw 			--host=${MACHINE_GNU_PLATFORM} \
     84   1.2   nathanw 			--target=${MACHINE_GNU_PLATFORM}) && \
     85   1.7       uwe 		(cd ${.OBJDIR}/.native && \
     86   1.7       uwe 			/usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \
     87   1.7       uwe 				${MAKE} configure-host) && \
     88   1.3   nathanw 		(cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \
     89   1.3   nathanw 		(cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c)
     90   1.2   nathanw 	@touch $@
     91   1.2   nathanw 
     92   1.2   nathanw clean: clean.native
     93   1.2   nathanw clean.native:
     94   1.2   nathanw 	-rm -r -f .native
     95