This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: use $(build_exeext) for gen*


This patch adds $(build_exeext) to all gen* and gen-protos 
targets, where required. Without this patch, under DJGPP, both 
genfoo and genfoo.exe were being created, and some make rules 
used to operate only on genfoo, while others on genfoo.exe. 
This patch fixes that confusion.

If somebody thinks that this patch introduces too much 
genfoo$(build_exeext) constructs, then I can modify it
to hide $(build_exeext) in make variables.

Tested under i686-pc-msdosdjgpp.

Is it OK?

Laurynas

2000-11-29  Laurynas Biveinis  <lauras@softhome.net>

	* Makefile.in: use $(build_exeext) for all build
        system executable targets.

--- Makefile.in.orig	Wed Nov 29 17:14:30 2000
+++ Makefile.in	Wed Nov 29 17:06:52 2000
@@ -744,8 +744,10 @@
 # GEN files are listed separately, so they can be built before doing parallel
 #  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
 #  them before rtl.o is compiled.
-GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
- genpeep gengenrtl gencheck
+GEN= genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
+ genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext)   \
+ genconfig$(build_exeext) genpeep$(build_exeext) gengenrtl$(build_exeext)    \
+ gencheck$(build_exeext)

 # Files to be copied away after each stage in building.
 STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
@@ -1248,12 +1250,12 @@
 cppspec.o: cppspec.c $(CONFIG_H) system.h $(GCC_H)

 tree-check.h: s-check ; @true
-s-check : gencheck $(srcdir)/move-if-change
+s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
 	./gencheck > tmp-check.h
 	$(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
 	touch s-check

-gencheck : gencheck.o $(HOST_LIBDEPS)
+gencheck$(build_exeext) : gencheck.o $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 gencheck.o $(HOST_LIBS)

@@ -1540,19 +1542,19 @@
 # trailing `;'), we call true for each.

 insn-config.h: s-config ; @true
-s-config : $(md_file) genconfig $(srcdir)/move-if-change
+s-config : $(md_file) genconfig$(build_exeext) $(srcdir)/move-if-change
 	./genconfig $(md_file) > tmp-config.h
 	$(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
 	touch s-config

 insn-flags.h: s-flags ; @true
-s-flags : $(md_file) genflags $(srcdir)/move-if-change
+s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change
 	./genflags $(md_file) > tmp-flags.h
 	$(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
 	touch s-flags

 insn-codes.h: s-codes ; @true
-s-codes : $(md_file) gencodes $(srcdir)/move-if-change
+s-codes : $(md_file) gencodes$(build_exeext) $(srcdir)/move-if-change
 	./gencodes $(md_file) > tmp-codes.h
 	$(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
 	touch s-codes
@@ -1563,7 +1565,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c

 insn-emit.c: s-emit ; @true
-s-emit : $(md_file) genemit $(srcdir)/move-if-change
+s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
 	./genemit $(md_file) > tmp-emit.c
 	$(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
 	touch s-emit
@@ -1573,7 +1575,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c

 insn-recog.c: s-recog ; @true
-s-recog : $(md_file) genrecog $(srcdir)/move-if-change
+s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
 	./genrecog $(md_file) > tmp-recog.c
 	$(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
 	touch s-recog
@@ -1583,7 +1585,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c

 insn-opinit.c: s-opinit ; @true
-s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
+s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change
 	./genopinit $(md_file) > tmp-opinit.c
 	$(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
 	touch s-opinit
@@ -1593,7 +1595,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c

 insn-extract.c: s-extract ; @true
-s-extract : $(md_file) genextract $(srcdir)/move-if-change
+s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change
 	./genextract $(md_file) > tmp-extract.c
 	$(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
 	touch s-extract
@@ -1603,7 +1605,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c

 insn-peep.c: s-peep ; @true
-s-peep : $(md_file) genpeep $(srcdir)/move-if-change
+s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change
 	./genpeep $(md_file) > tmp-peep.c
 	$(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
 	touch s-peep
@@ -1613,13 +1615,13 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c

 insn-attr.h: s-attr ; @true
-s-attr : $(md_file) genattr $(srcdir)/move-if-change
+s-attr : $(md_file) genattr$(build_exeext) $(srcdir)/move-if-change
 	./genattr $(md_file) > tmp-attr.h
 	$(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
 	touch s-attr

 insn-attrtab.c: s-attrtab ; @true
-s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
+s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change
 	./genattrtab $(md_file) > tmp-attrtab.c
 	$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
 	touch s-attrtab
@@ -1630,7 +1632,7 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c

 insn-output.c: s-output ; @true
-s-output : $(md_file) genoutput $(srcdir)/move-if-change
+s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change
 	./genoutput $(md_file) > tmp-output.c
 	$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
 	touch s-output
@@ -1639,7 +1641,7 @@
 genrtl.c genrtl.h : s-genrtl
 	@true	# force gnu make to recheck modification times.

-s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H)
+s-genrtl: gengenrtl$(build_exeext) $(srcdir)/move-if-change $(RTL_BASE_H)
 	./gengenrtl -h >tmp-genrtl.h
 	$(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
 	./gengenrtl >tmp-genrtl.c
@@ -1664,7 +1666,7 @@
 	$(LN_S) $(srcdir)/../libiberty/hashtab.c hashtab.c
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) hashtab.c

-genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genconfig$(build_exeext) : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	  genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1672,7 +1674,7 @@
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c

-genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genflags$(build_exeext) : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1680,7 +1682,7 @@
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c

-gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+gencodes$(build_exeext) : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1688,14 +1690,14 @@
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c

-genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genemit$(build_exeext) : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

 genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c

-genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genopinit$(build_exeext) : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1703,14 +1705,15 @@
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c

-genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genrecog$(build_exeext) : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

 genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
-genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+	
+genextract$(build_exeext) : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1718,21 +1721,21 @@
   system.h insn-config.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c

-genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genpeep$(build_exeext) : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

 genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c

-genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genattr$(build_exeext) : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

 genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c

-genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genattrtab$(build_exeext) : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1740,7 +1743,7 @@
   system.h errors.h $(GGC_H) gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c

-genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
+genoutput$(build_exeext) : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)

@@ -1748,7 +1751,7 @@
   system.h errors.h gensupport.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c

-gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
+gengenrtl$(build_exeext) : gengenrtl.o $(HOST_LIBDEPS)
 	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	 gengenrtl.o $(HOST_LIBS)

@@ -2081,8 +2084,8 @@
 	fi

 GEN_PROTOS_OBJS = gen-protos.o scan.o
-gen-protos: $(GEN_PROTOS_OBJS)
-	${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gen-protos \
+gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
+	${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
 	  $(GEN_PROTOS_OBJS) ../libiberty/libiberty.a

 gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
@@ -2091,7 +2094,7 @@
 scan.o: scan.c scan.h $(build_xm_file) system.h
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c

-xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
+xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
 	sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
 	  deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
 	mv tmp-fixtmp.c fixtmp.c
@@ -2220,7 +2223,7 @@
 	-rm -f collect collect2 mips-tfile mips-tdump alloca.s
 # Delete files generated for fixproto
 	-rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
-	  gen-protos fixproto.list fixtmp.* fixhdr.ready
+	  gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
 # Delete files generated for fixincl
 	-rm -rf fixincl fixinc.sh specs.ready
 	(cd fixinc && $(MAKE) clean)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]