From 460ad044bc85574e9acea9dade6ce7dda56ac742 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 16 Apr 2019 21:16:43 +0000 Subject: [PATCH] d: Use build_exeext suffix for D generator programs. Updated build and invocation of idgen and impcnvgen, ensuring that they are removed when cleaning the build directory. Added BUILD_LIBDEPS on the link command for the generator programs as well, which is necessary when the system installed compiler is not GCC. gcc/d/ChangeLog: 2019-04-16 Iain Buclaw * Make-lang.in (d.mostyclean): Clean idgen and impcnvgen. (d/idgen): Rename to d/idgen$(build_exeext), add BUILD_LIBDEPS. (d/impcnvgen): Rename to d/impcnvgen$(build_exeext), add BUILD_LIBDEPS. (d/id.c): Call idgen$(build_exeext). (d/impcnvtab.c): Call impcnvgen$(build_exeext). From-SVN: r270397 --- gcc/d/ChangeLog | 8 ++++++++ gcc/d/Make-lang.in | 21 ++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index 425ce25ec31..d0210ff43e8 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,11 @@ +2019-04-16 Iain Buclaw + + * Make-lang.in (d.mostyclean): Clean idgen and impcvgen. + (d/idgen): Rename to d/idgen$(build_exeext), add BUILD_LIBDEPS. + (d/impcvgen): Rename to d/impcvgen$(build_exeext), add BUILD_LIBDEPS. + (d/id.c): Call idgen$(build_exeext). + (d/impcnvtab.c): Call impcvgen$(build_exeext). + 2019-04-14 Johannes Pfau PR d/87799 * d-system.h (_mkdir): Forward _mkdir on MinGW to mkdir in system.h. 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) d.clean: d.distclean: d.maintainer-clean: @@ -316,21 +317,23 @@ d/%.o: d/dmd/root/%.c $(D_GENERATED_SRCS) $(POSTCOMPILE) # Generated programs. -d/idgen: d/idgen.dmdgen.o - +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ $^ +d/idgen$(build_exeext): d/idgen.dmdgen.o $(BUILD_LIBDEPS) + +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \ + $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS) -d/impcvgen: d/impcnvgen.dmdgen.o - +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ $^ +d/impcnvgen$(build_exeext): d/impcnvgen.dmdgen.o $(BUILD_LIBDEPS) + +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \ + $(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 $(DMDGEN_COMPILE) $(D_INCLUDES) $< -- 2.30.2