d: Use build_exeext suffix for D generator programs.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 16 Apr 2019 21:16:43 +0000 (21:16 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Tue, 16 Apr 2019 21:16:43 +0000 (21:16 +0000)
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  <ibuclaw@gdcproject.org>

* 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
gcc/d/Make-lang.in

index 425ce25ec3153fea727479b9f34ac7a1aa513925..d0210ff43e8b5013e50ba47068aa7c604edb9933 100644 (file)
@@ -1,3 +1,11 @@
+2019-04-16  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * 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  <johannespfau@gmail.com>
        PR d/87799
        * d-system.h (_mkdir): Forward _mkdir on MinGW to mkdir in system.h.
index 4e5b4a6c0c4ad16baba5436e9d2f61d2becb6e9f..13b785e86a15a9e6bec2c50bc946ab7a707aa1bf 100644 (file)
@@ -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) $<