Subject: Simplified lib/libc/gen/Makefile.inc
To: None <tech-ports@netbsd.org>
From: Andrew Cagney <cagney@highland.com.au>
List: tech-ports
Date: 11/24/1994 11:35:00
Hello,

(oops, this comment applies to a NetBSD-1.0-beta release ...)

Can I suggest that the file:

	lib/libc/gen/Makefile.inc

be changed (as seen in the patch below) so that instead of containing a
long list of `.if arch == ... then SRCS+= ...' to instead include an
additional Makefile.inc from the architecture specific gen directory.

This removes any need for new ports to (continualy) modify this generic
file.  As a change, it probably has wider applicability.

					regards, Andrew


*** 1.1	1994/11/24 00:12:48
--- lib/libc/gen/Makefile.inc	1994/11/24 00:23:32
***************
*** 1,5 ****
  #	from: @(#)Makefile.inc	5.21 (Berkeley) 5/24/91
! #	$Id: Makefile.inc,v 1.1 1994/11/24 00:12:48 cagney Exp $
  
  # gen sources
  .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen
--- 1,5 ----
  #	from: @(#)Makefile.inc	5.21 (Berkeley) 5/24/91
! #	$Id: Makefile.inc,v 1.3 1994/11/24 00:23:00 cagney Exp $
  
  # gen sources
  .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen
***************
*** 26,55 ****
  	utime.c valloc.c vis.c wait.c wait3.c \
  	waitpid.c
  
! .if   (${MACHINE_ARCH} == "m68k")
! SRCS+=	_setjmp.S alloca.S fabs.S frexp.c ldexp.S modf.S setjmp.S
! SRCS+=	adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \
! 	divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
! 	floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \
! 	negdf2.S negsf2.S saveregs.c subdf3.S subsf3.S truncdfsf2.S udivsi3.S \
! 	umodsi3.S umulsi3.S
! .elif (${MACHINE_ARCH} == "i386")
! SRCS+=	_setjmp.S alloca.S fabs.S frexp.c ldexp.c modf.S setjmp.S sigsetjmp.S
! SRCS+=	divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
! .elif (${MACHINE_ARCH} == "ns32k")
! SRCS+=	__main.c _setjmp.S alloca.S fabs.S frexp.S infinity.c isinf.c
! SRCS+=  ldexp.S modf.S setjmp.S
! .elif (${MACHINE_ARCH} == "tahoe")
! CFLAGS+=-I/sys
! SRCS+=	_setjmp.S alloca.S fabs.S frexp.c ldexp.S modf.S setjmp.S
! SRCS+=	udiv.S urem.S
! .elif (${MACHINE_ARCH} == "vax")
! SRCS+=	_setjmp.S alloca.S fabs.S frexp.c ldexp.S modf.S setjmp.S
! SRCS+=	udiv.S urem.S
! .elif (${MACHINE_ARCH} == "sparc")
! SRCS+=	_setjmp.S fabs.S frexp.c infinity.c isnan.c ldexp.c modf.S
! SRCS+=	fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S
! .endif
  
  MAN3+=	alarm.0 clock.0 confstr.0 ctermid.0 ctime.0 ctype.0 \
  	daemon.0 devname.0 directory.0 err.0 exec.0 fnmatch.0 frexp.0 \
--- 26,33 ----
  	utime.c valloc.c vis.c wait.c wait3.c \
  	waitpid.c
  
! # Get the host specific source files
! .include "${.CURDIR}/arch/${MACHINE_ARCH}/gen/Makefile.inc"
  
  MAN3+=	alarm.0 clock.0 confstr.0 ctermid.0 ctime.0 ctype.0 \
  	daemon.0 devname.0 directory.0 err.0 exec.0 fnmatch.0 frexp.0 \