Subject: port-sparc/1485: sparc stand doesn't build libs in obj dirs.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mrg@eterna.com.au>
List: netbsd-bugs
Date: 09/20/1995 20:15:02
>Number:         1485
>Category:       port-sparc
>Synopsis:       sparc stand doesn't build libs in obj dirs.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 20 06:20:01 1995
>Last-Modified:
>Originator:     matthew green
>Organization:
bozotic softwar foundation
>Release:        19 september.
>Environment:
	
System: NetBSD splode.eterna.com.au 1.0A NetBSD 1.0A (_splode_) #250: Fri Sep 15 23:39:27 EST 1995 mrg@splode.eterna.com.au:/orb/q/build/src/sys/arch/sparc/compile/_splode_ sparc


>Description:

	the new sparc/stand Makefile builds the sa and kern libraries
	in to sparc/stand/lib/{kern,sa}, not using the obj directories
	that everything else does.

	there are more problems also.

	the {,install}boot{,xx}/Makefile's need a ${.CURDIR} for both
	the PATH and LIBS variables, before the ${R} variable.  but,
	there are other dependancies on path names for the -I's passed
	to ${CC}.  and a few more problems.

>How-To-Repeat:

	cd sys/arch/sparc/stand; make obj && make ; ls lib/sa

>Fix:

	below is a fix for the Makefile's to make it actually build with
	obj dirs.  the lib problem hasn't been addressed -- i'm not sure
	what the answer is.


Index: Makefile.inc
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/stand/Makefile.inc,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile.inc
*** Makefile.inc	1995/09/20 07:53:16	1.1.1.1
--- Makefile.inc	1995/09/20 10:03:54
***************
*** 12,18 ****
  # Note: a `RELOC' value of 0x340000 seems to work on most machines
  RELOC?=		${RELOC_SUN4C}
  
! INCLUDES+=	-I.. -I${S}/arch -I${S} -I${S}/lib/libsa
  DEFS+=		-DSTANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS
  CFLAGS+=	-O2 ${INCLUDES} ${DEFS}
  
--- 12,18 ----
  # Note: a `RELOC' value of 0x340000 seems to work on most machines
  RELOC?=		${RELOC_SUN4C}
  
! INCLUDES+=	-I${.CURDIR}/.. -I${.CURDIR}/${S}/arch -I${.CURDIR}/${S} -I${.CURDIR}/${S}/lib/libsa
  DEFS+=		-DSTANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS
  CFLAGS+=	-O2 ${INCLUDES} ${DEFS}
  
Index: boot/Makefile
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/stand/boot/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1995/09/20 07:53:23	1.1.1.1
--- Makefile	1995/09/20 10:08:23
***************
*** 1,15 ****
  #	$NetBSD: Makefile,v 1.1 1995/09/16 23:21:56 pk Exp $
  
  R=	..
! .PATH:	${R}
  PROG=	boot
  SRCS=	srt0.S boot.c promdev.c dvma.c net.c netif_sun.c conf.c version.c
  NOMAN=	1
  BINDIR=	/usr/mdec
! LIBS!=	cd ./${R}; ${MAKE} libdep
  
  ${PROG}:${OBJS} ${LIBS:S,^,../,g}
! 	${LD} -N -T ${RELOC} -e start ${OBJS} ${LIBS:S,^,../,g}
  	# convert to Sun magic
  	(echo -n 01 | tr 01 '\01\03'; tail +3c a.out) > ${.TARGET}
  	@rm a.out
--- 1,15 ----
  #	$NetBSD: Makefile,v 1.1 1995/09/16 23:21:56 pk Exp $
  
  R=	..
! .PATH:	${.CURDIR}/${R}
  PROG=	boot
  SRCS=	srt0.S boot.c promdev.c dvma.c net.c netif_sun.c conf.c version.c
  NOMAN=	1
  BINDIR=	/usr/mdec
! LIBS!=	cd ${.CURDIR}/${R}; ${MAKE} libdep
  
  ${PROG}:${OBJS} ${LIBS:S,^,../,g}
! 	${LD} -N -T ${RELOC} -e start ${OBJS} ${LIBS:S,^,${.CURDIR}/../,g}
  	# convert to Sun magic
  	(echo -n 01 | tr 01 '\01\03'; tail +3c a.out) > ${.TARGET}
  	@rm a.out
Index: bootxx/Makefile
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/stand/bootxx/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1995/09/20 07:53:23	1.1.1.1
--- Makefile	1995/09/20 10:09:24
***************
*** 1,18 ****
  #	$NetBSD: Makefile,v 1.2 1995/09/18 23:32:41 pk Exp $
  
  R=	..
! .PATH:	${R}
  PROG=	bootxx
  SRCS=	srt0.S bootxx.c promdev.c dvma.c
  NOMAN=	1
  STRIP=
  BINDIR=	/usr/mdec
! LIBS!=	cd ./${R}; ${MAKE} libdep
  
  CFLAGS= -DBOOTXX
  
  bootxx:	${OBJS} ${LIBS:S,^,../,g}
! 	${LD} -N -T ${RELOC} -e start ${OBJS} ${LIBS:S,^,../,g}
  	# convert to Sun magic
  	(echo -n 01 | tr 01 '\01\03'; tail +3c a.out) > ${.TARGET}
  	@rm a.out
--- 1,18 ----
  #	$NetBSD: Makefile,v 1.2 1995/09/18 23:32:41 pk Exp $
  
  R=	..
! .PATH:	${.CURDIR}/${R}
  PROG=	bootxx
  SRCS=	srt0.S bootxx.c promdev.c dvma.c
  NOMAN=	1
  STRIP=
  BINDIR=	/usr/mdec
! LIBS!=	cd ${.CURDIR}/${R}; ${MAKE} libdep
  
  CFLAGS= -DBOOTXX
  
  bootxx:	${OBJS} ${LIBS:S,^,../,g}
! 	${LD} -N -T ${RELOC} -e start ${OBJS} ${LIBS:S,^,${.CURDIR}/../,g}
  	# convert to Sun magic
  	(echo -n 01 | tr 01 '\01\03'; tail +3c a.out) > ${.TARGET}
  	@rm a.out
Index: installboot/Makefile
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/stand/installboot/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1995/09/20 07:53:23	1.1.1.1
--- Makefile	1995/09/20 08:55:22
***************
*** 1,6 ****
  #	$NetBSD: Makefile,v 1.2 1995/09/18 23:33:42 pk Exp $
  
! .PATH:	..
  PROG=	installboot
  NOMAN=1
  BINDIR=/usr/mdec
--- 1,6 ----
  #	$NetBSD: Makefile,v 1.2 1995/09/18 23:33:42 pk Exp $
  
! .PATH:	${.CURDIR}/..
  PROG=	installboot
  NOMAN=1
  BINDIR=/usr/mdec
>Audit-Trail:
>Unformatted: