Re: Warning with loader Makefile?

From: Andrew Turner <zombie_at_i4free.co.nz>
Date: Fri, 08 Aug 2003 11:25:49 +1200
Nate Lawson wrote:
> I get this:
> ===> i386/cdboot
> ===> i386/kgzldr
> ===> i386/libi386
> ===> i386/loader
> "/usr/share/mk/bsd.prog.mk", line 38: warning: duplicate script for target "loader" ignored
> cc -nostdlib -static -Ttext 0x0 -o loader.sym
> /home/obj/home/src/sys/boot/i386/loader/../btx/lib/crt0.o main.o conf.o
> bcache.o boot.o commands.o console.o devopen.o interp.o interp_backslash.o
> interp_parse.o ls.o misc.o module.o panic.o load_elf32.o load_elf64.o
> isapnp.o pnp.o interp_forth.o vers.o
> 
> Why is there a duplicate script?

I found this patch worked by removing the secound ${PROG} target if 
there was already one there.

Andrew

--- /usr/src/share/mk/bsd.prog.mk	Mon Jun 30 06:16:26 2003
+++ /usr/share/mk/bsd.prog.mk	Mon Aug  4 17:54:22 2003
_at__at_ -31,11 +31,13 _at__at_
 
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 
+.if !target(${PROG})
 ${PROG}: ${OBJS}
 .if defined(PROG_CXX)
 	${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
 .else
 	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
+.endif
 .endif
 
 .else !defined(SRCS)
Received on Thu Aug 07 2003 - 14:27:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:18 UTC