aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc
diff options
context:
space:
mode:
authorBruce Korb <bkorb@gnu.org>2000-04-25 23:03:49 +0000
committerBruce Korb <korbb@gcc.gnu.org>2000-04-25 23:03:49 +0000
commit7d7f30cfa079711cb56d1b48fa107c398af4f514 (patch)
tree8b1e5a6026412940944c8dd35c21e5872242c9fb /gcc/fixinc
parent932207025a862cbea7b863894615efe64cc8d471 (diff)
downloadgcc-7d7f30cfa079711cb56d1b48fa107c398af4f514.zip
gcc-7d7f30cfa079711cb56d1b48fa107c398af4f514.tar.gz
gcc-7d7f30cfa079711cb56d1b48fa107c398af4f514.tar.bz2
use install-bin and install-sh in fixinc's makefile
From-SVN: r33423
Diffstat (limited to 'gcc/fixinc')
-rw-r--r--gcc/fixinc/Makefile.in63
-rwxr-xr-xgcc/fixinc/mkfixinc.sh21
2 files changed, 40 insertions, 44 deletions
diff --git a/gcc/fixinc/Makefile.in b/gcc/fixinc/Makefile.in
index 8e88649..31c1964 100644
--- a/gcc/fixinc/Makefile.in
+++ b/gcc/fixinc/Makefile.in
@@ -96,14 +96,20 @@ procopen.o : procopen.c server.h
fixlib.o: machname.h
fixincl.x: fixincl.tpl inclhack.def
- cd $(srcdir) ; ./genfixes $@
+ cd $(srcdir) ; $(SHELL) ./genfixes $@
inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
- cd $(srcdir) ; ./genfixes $@
+ cd $(srcdir) ; $(SHELL) ./genfixes $@
# fixinc.sh, unlike the other two, has _no_ dependency on the .def file.
fixincl.sh: inclhack.tpl
- cd $(srcdir) ; ./genfixes $@
+ cd $(srcdir) ; $(SHELL) ./genfixes $@
+
+# This invocation of genfixes is done from the build dir,
+# not the source dir (as above)
+#
+machname.h: ../specs
+ $(SHELL) $(srcdir)/genfixes $@
clean:
rm -f *.o $(TARGETS) fixincl.x machname.h
@@ -113,30 +119,33 @@ clean:
# "inclhack.sh" script. Otherwise, we install that program
# plus the wrapper script, "fixincl.sh".
#
-install: $(TARGETS)
- @rm -f ../fixinc.sh ; \
- if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
- echo cp fixincl.sh ../fixinc.sh ; \
- if [ -f ./fixincl.sh ] ; \
- then cp fixincl.sh ../fixinc.sh ; \
- else cp $(srcdir)/fixincl.sh ../fixinc.sh ; fi ; \
- chmod 555 ../fixinc.sh ; \
- rm -f ../fixincl ; \
- echo cp fixincl .. ; \
- cp fixincl .. ; \
- chmod 555 ../fixincl ; \
- else \
- echo Could not install binary fixincludes. ; \
- echo Installing shell script instead. ; \
- echo cp inclhack.sh ../fixinc.sh ; \
- if [ -f ./inclhack.sh ] ; \
- then cp inclhack.sh ../fixinc.sh ; \
- else cp $(srcdir)/inclhack.sh ../fixinc.sh ; fi ; \
- fi
+install-bin: fixincl fixincl.sh
+ @if [ -f ../fixincl ] ; then rm -f ../fixincl || \
+ mv -f ../fixincl ../fixincl.$$ || exit 1 ; fi
+ @if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
+ mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; fi
+ ./fixincl -v
+ cp fixincl ..
+ @if [ -f ./fixincl.sh ] ; \
+ then echo cp ./fixincl.sh ../fixinc.sh ; \
+ cp ./fixincl.sh ../fixinc.sh ; \
+ else echo cp $(srcdir)/fixincl.sh ../fixinc.sh ; \
+ cp $(srcdir)/fixincl.sh ../fixinc.sh ; fi
+ chmod 755 ../fixinc.sh ../fixincl
+
+install-sh: fixfixes fixtests inclhack.sh
+ @if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
+ mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; fi
+ echo Could not install binary fixincludes. ; \
+ echo Installing shell script instead.
+ @if [ -f ./fixincl.sh ] ; \
+ then echo cp ./inclhack.sh ../fixinc.sh ; \
+ cp ./inclhack.sh ../fixinc.sh ; \
+ else echo cp $(srcdir)/inclhack.sh ../fixinc.sh ; \
+ cp $(srcdir)/inclhack.sh ../fixinc.sh ; fi
+ chmod 755 ../fixinc.sh
Makefile: Makefile.in ../config.status
cd .. \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-machname.h: ../specs
- $(SHELL) $(srcdir)/genfixes $@
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+ $(SHELL) ./config.status
diff --git a/gcc/fixinc/mkfixinc.sh b/gcc/fixinc/mkfixinc.sh
index 7d36a27..ead6b15 100755
--- a/gcc/fixinc/mkfixinc.sh
+++ b/gcc/fixinc/mkfixinc.sh
@@ -117,24 +117,11 @@ fi
# OK. We gotta make the thing.
#
-echo $MAKE SHELL=\"$SHELL\" install
+echo $MAKE SHELL=\"$SHELL\" install-bin
# make and install either the binary or the default script
#
-$MAKE SHELL="$SHELL" install && chmod 755 ${target} && exit 0
+$MAKE SHELL="$SHELL" install-bin && exit 0
-# Where is our inclhack script? That is the backup
-# in case we are unable to make a working binary.
-#
-if test -f ./inclhack.sh
-then
- INCLHACK=./inclhack.sh
-else
- INCLHACK=${srcdir}/inclhack.sh
-fi
-
-echo Could not install binary fixincludes.
-echo Installing shell script instead.
-
-cp ${INCLHACK} ${target}
-chmod 755 ${target}
+echo $MAKE SHELL=\"$SHELL\" install-sh
+$MAKE SHELL="$SHELL" install-sh