diff mbox series

[d] Committed use build_exeext suffix for D generator programs.

Message ID CABOHX+enK3rRg1AaOjaAf61z=rpGE58ENSh1J-VvqOZrgNZ=fw@mail.gmail.com
State New
Headers show
Series [d] Committed use build_exeext suffix for D generator programs. | expand

Commit Message

Iain Buclaw April 16, 2019, 9:17 p.m. UTC

This patch updates the build and invocation of idgen and impcnvgen,
ensuring that they are removed when cleaning the build directory.

Added BUILD_LIBDEPS on the link command, which is necessary when the
system installed compiler is not gcc, as noticed when testing
compilation on OpenBSD.

Bootstrapped and regression tested on x86_64-linux-gnu.

Committed to trunk as r270397.
diff mbox series


diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 4e5b4a6c0c4..13b785e86a1 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -279,7 +279,8 @@  d.mostlyclean:
 	-rm -f d/*$(objext)
 	-rm -f d/*$(coverageexts)
 	-rm -f $(D_GENERATED_SRCS)
-	-rm -f d/gdc$(exeext) gdc-cross$(exeext) d/d21$(exeext)
+	-rm -f d/idgen$(build_exeext) d/impcnvgen$(build_exeext)
+	-rm -f gdc$(exeext) gdc-cross$(exeext) d21$(exeext)
@@ -316,21 +317,23 @@  d/%.o: d/dmd/root/%.c $(D_GENERATED_SRCS)
 # Generated programs.
-d/idgen: d/idgen.dmdgen.o
+d/idgen$(build_exeext): d/idgen.dmdgen.o $(BUILD_LIBDEPS)
+	    $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
-d/impcvgen: d/impcnvgen.dmdgen.o
+d/impcnvgen$(build_exeext): d/impcnvgen.dmdgen.o $(BUILD_LIBDEPS)
+	    $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
 # Generated sources.
-d/id.c: d/idgen
-	cd d && ./idgen
+d/id.c: d/idgen$(build_exeext)
+	cd d && ./idgen$(build_exeext)
 # idgen also generates id.h; just verify it exists.
 d/id.h: d/id.c
-d/impcnvtab.c: d/impcvgen
-	cd d && ./impcvgen
+d/impcnvtab.c: d/impcnvgen$(build_exeext)
+	cd d && ./impcnvgen$(build_exeext)
 d/%.dmdgen.o: $(srcdir)/d/dmd/%.c