Convert fixcoff into a true host tool by making it under tools.
This commit is contained in:
parent
235e090dea
commit
98c902b471
@ -1,5 +1,10 @@
|
||||
# $NetBSD: Makefile,v 1.4 2002/05/18 04:06:12 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.5 2003/12/11 00:27:42 matt Exp $
|
||||
|
||||
SUBDIR= bootxx fixcoff ofwboot
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.if ${USETOOLS} != "yes"
|
||||
SUBDIR= fixcoff .WAIT
|
||||
.endif
|
||||
SUBDIR+= bootxx ofwboot
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -1,14 +1,9 @@
|
||||
# $NetBSD: Makefile,v 1.5 2003/12/10 23:45:25 matt Exp $
|
||||
|
||||
NOMAN= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
HOSTPROG= fixcoff
|
||||
SRCS= fixcoff.c nb_progname.c
|
||||
# $NetBSD: Makefile,v 1.6 2003/12/11 00:27:42 matt Exp $
|
||||
|
||||
.if ${USETOOLS} == "yes"
|
||||
PROG= fixcoff
|
||||
.include <bsd.prog.mk>
|
||||
.else
|
||||
HOSTPROG= fixcoff
|
||||
.include <bsd.hostprog.mk>
|
||||
|
||||
COMPATOBJ!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
|
||||
.-include "${COMPATOBJ}/defs.mk"
|
||||
|
||||
.endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fixcoff.c,v 1.7 2003/12/10 23:36:07 matt Exp $ */
|
||||
/* $NetBSD: fixcoff.c,v 1.8 2003/12/11 00:27:42 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 National Aeronautics & Space Administration
|
||||
@ -41,6 +41,10 @@
|
||||
* Partially inspired by hack-coff, written by Paul Mackerras.
|
||||
*/
|
||||
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include "nbtool_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
@ -1,58 +0,0 @@
|
||||
/* $NetBSD: nb_progname.c,v 1.1 2001/10/20 06:14:30 jmc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Todd Vierling.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Stub to emulate [gs]etprogname() where needed. */
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/param.h>
|
||||
#if !defined(__NetBSD_Version__) || (__NetBSD_Version__ < 106000000)
|
||||
#undef __NetBSD__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __NetBSD__
|
||||
const char *ln_progname;
|
||||
|
||||
void setprogname(const char *progname) {
|
||||
ln_progname = progname;
|
||||
}
|
||||
|
||||
const char *getprogname(void) {
|
||||
return ln_progname;
|
||||
}
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.38 2003/10/26 07:25:36 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.39 2003/12/11 00:27:42 matt Exp $
|
||||
|
||||
S= ${.CURDIR}/../../../..
|
||||
|
||||
@ -32,15 +32,10 @@ BINMODE= 444
|
||||
.if !defined(FIXCOFF)
|
||||
.include <bsd.own.mk>
|
||||
|
||||
FIXCOFFDIR!= cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
|
||||
FIXCOFF= ${FIXCOFFDIR}/fixcoff
|
||||
FIXCOFFTARG= ${FIXCOFF}
|
||||
|
||||
${FIXCOFF}:
|
||||
(cd ${.CURDIR}/../fixcoff; ${MAKE})
|
||||
|
||||
.else
|
||||
FIXCOFFTARG=
|
||||
.if !defined(TOOL_MACPPCFIXCOFF)
|
||||
TOOL_MACPPCFIXCOFFDIR!= cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
|
||||
TOOL_MACPPCFIXCOFF= ${FIXCOFFDIR}/fixcoff
|
||||
.endif
|
||||
.endif
|
||||
|
||||
NEWVERSWHAT= "OpenFirmware Boot"
|
||||
@ -107,10 +102,10 @@ ${PROG}.elf: ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
|
||||
${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
|
||||
${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
|
||||
|
||||
${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
|
||||
${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN}
|
||||
${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
|
||||
-Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \
|
||||
${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
|
||||
${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
|
||||
${PROG}.mrg ${PROG}.xcf
|
||||
${FIXCOFF} ${PROG}.xcf
|
||||
${TOOL_MACPPCFIXCOFF} ${PROG}.xcf
|
||||
|
Loading…
Reference in New Issue
Block a user