Module Name:    src
Committed By:   riastradh
Date:           Thu Apr  3 18:27:37 UTC 2014

Modified Files:
        src/share/mk: sys.mk

Log Message:
By default define CTFCONVERT and CTFMERGE to be no-ops in sys.mk.

Don't test for /usr/bin/ctfconvert or /usr/bin/ctfmerge -- that is
completely bonkers and breaks the build if the host's ctfconvert and
ctfmerge are too old.

Strip the broken conditionals in the .c.o &c. rules.

bsd.own.mk will override CTFCONVERT and CTFMERGE with TOOL_CTFCONVERT
and TOOL_CTFMERGE if MKCTF=yes.

XXX The way CTFCONVERT and CTFMERGE are integrated into the rules is
bogus -- it is not safe to interrupt them.  We need some intermediate
object to do this right.

Please let me know if I broke anything with this -- I am not an elvin
or dwarven wizard, nor a dtrace expert.  But this has been breaking
builds for ages now and nobody else seems to want to do anything
about it.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/share/mk/sys.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.122 src/share/mk/sys.mk:1.123
--- src/share/mk/sys.mk:1.122	Sun Mar  9 19:10:01 2014
+++ src/share/mk/sys.mk	Thu Apr  3 18:27:37 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.122 2014/03/09 19:10:01 christos Exp $
+#	$NetBSD: sys.mk,v 1.123 2014/04/03 18:27:37 riastradh Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -49,10 +49,8 @@ CTFMFLAGS	?=	-S 1 -g -t -L VERSION
 
 # We have to define these here, because if we don't the rules below will
 # not work
-.if exists(/usr/bin/ctfconvert) && exists(/usr/bin/ctfmerge)
-CTFCONVERT	?=	ctfconvert
-CTFMERGE	?=	ctfmerge
-.endif
+CTFCONVERT	?=	: ctfconvert
+CTFMERGE	?=	: ctfmerge
 
 CXX?=		c++
 CXXFLAGS?=	${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length}
@@ -120,14 +118,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 .c:
 	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 # XXX: disable for now
-#.if defined(CTFCONVERT)
 #	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-#.endif
 .c.o:
 	${COMPILE.c} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .c.a:
 	${COMPILE.c} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -152,9 +146,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .f.o:
 	${COMPILE.f} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .f.a:
 	${COMPILE.f} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -162,14 +154,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 
 .F:
 	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .F.o:
 	${COMPILE.F} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .F.a:
 	${COMPILE.F} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -179,9 +167,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .r.o:
 	${COMPILE.r} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .r.a:
 	${COMPILE.r} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -190,14 +176,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Pascal
 .p:
 	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .p.o:
 	${COMPILE.p} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .p.a:
 	${COMPILE.p} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -206,28 +188,20 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Assembly
 .s:
 	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .s.o:
 	${COMPILE.s} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .s.a:
 	${COMPILE.s} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
 	rm -f ${.PREFIX}.o
 .S:
 	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .S.o:
 	${COMPILE.S} ${.IMPSRC}
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 .S.a:
 	${COMPILE.S} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -244,9 +218,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .l.o:
 	${LEX.l} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} lex.yy.c
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 	rm -f lex.yy.c
 
 # Yacc
@@ -260,9 +232,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .y.o:
 	${YACC.y} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} y.tab.c
-.if defined(CTFCONVERT)
 	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
 	rm -f y.tab.c
 
 # Shell

Reply via email to