Subject: kern/2436: aic7xxx_seq.h should get built before main make depend happens
To: None <gnats-bugs@NetBSD.ORG>
From: James Michael Chacon <jmc@hedgehog.com>
List: netbsd-bugs
Date: 05/19/1996 04:22:29
>Number:         2436
>Category:       kern
>Synopsis:       aic7xxx_seq.h should get built before main make depend happens
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 19 08:05:07 1996
>Last-Modified:
>Originator:     Bourne-again Superuser
>Organization:
>Release:        may-18-96
>Environment:
486-dx4133, may15th kernel, may 18th userland build.
System: NetBSD quix 1.1B NetBSD 1.1B (QUIX) #27: Wed May 15 23:54:32 PDT 1996 root@quix:/export/data/src-current/NetBSD-current/src/sys/arch/i386/compile/QUIX i386


>Description:

        When the i386 port includes the microcode Makefile.inc it does it
at the bottom of Makefile.i386. This is so it can determine if aic7xxx.o is
a target and if so, add the rules for building the microcode sequences.

This Makefile.inc needs a depend rule adding aic7xxx_seq.h to it, so this
header file gets built before the main make depend occurs on all the source
files.

However, with the way the depend rule is structured in the Makefile.i386 file,
it won't pick up a depend:: rule from the microcode Makefile.inc till after
it's done trying to do the main make depend. This makes the main make depend
lose on aix7xxx.c since it tries to include aic7xxx_seq.h The depend rule 
should be moved to the end of Makefile.i386 to make sure it's the absolute
last depend that occurs. As a matter of fact, probably all :: rules that
any *.inc Makefiles can add to should be moved after all .include's, but
the attached patch only does depend.

>How-To-Repeat:
	Add ahc drivers to any i386 kernel and then config and try a make
depend.

>Fix:
Apply the attached patch to sys/dev/microcode/aic7xxx/Makefile.inc and
sys/arch/i386/conf/Makefile.i386

Index: sys/dev/microcode/aic7xxx/Makefile.inc
===================================================================
RCS file: /export/data/src-current/cvs/NetBSD-current/src/sys/dev/microcode/aic7xxx/Makefile.inc,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 Makefile.inc
*** Makefile.inc        1996/05/17 14:56:36     1.1.1.3
--- Makefile.inc        1996/05/19 10:59:39
***************
*** 8,13 ****
--- 8,15 ----
  
  aic7xxx_asm: $S/dev/microcode/aic7xxx/aic7xxx_asm.c
  
+ depend:: aic7xxx_seq.h
+ 
  clean::
        rm -f aic7xxx_asm
  .endif
 
Index: src/sys/arch/i386/conf/Makefile.i386
===================================================================
RCS file: /export/data/src-current/cvs/NetBSD-current/src/sys/arch/i386/conf/Makefile.i386,v
retrieving revision 1.3
diff -c -r1.3 Makefile.i386
*** Makefile.i386       1996/05/19 04:00:45     1.3
--- Makefile.i386       1996/05/19 10:59:22
***************
*** 146,158 ****
  
  SRCS= ${I386}/i386/locore.s \
        param.c ioconf.c ${CFILES} ${SFILES}
- depend:: .depend
- .depend: ${SRCS} assym.h param.c
-       mkdep ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
-       mkdep -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
-       mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
-       mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${I386}/i386/genassym.c
- 
  
  # depend on root or device configuration
  autoconf.o conf.o: Makefile
--- 146,151 ----
***************
*** 174,176 ****
--- 167,176 ----
  
  ### add microcode dependencies
  .include "$S/dev/microcode/Makefile.inc"
+ 
+ depend:: .depend
+ .depend: ${SRCS} assym.h param.c
+       mkdep ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
+       mkdep -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
+       mkdep -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
+       mkdep -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${I386}/i386/genassym.c




>Audit-Trail:
>Unformatted: