avoid creating include as file

DJ Delorie dj@delorie.com
Wed Mar 15 12:54:00 GMT 2000


It happened to me that the Makefile didn't create the include
directory before running the step that fills it (not sure if it was my
fault or gcc's).  The first "cp $$file include" created a *file*
called include.  With this proposed change, it will still fail in
those rare cases, but at least it will be more easily recoverable and
will fail in a more sane way, in that it will report "include/.: no
such directory" instead of, on the next pass, "include/stdarg.h: not a
directory"

2000-03-15  DJ Delorie  <dj@delorie.com>

	* Makefile.in: Make sure "include" isn't accidentally created
	as a file.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.402
diff -c -3 -p -r1.402 Makefile.in
*** Makefile.in 2000/03/14 18:36:17     1.402
--- Makefile.in 2000/03/15 20:39:35
*************** stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) 
*** 2152,2158 ****
            realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
            touch include/$$realfile; \
            rm -f include/$$realfile; \
!           cp $$file include; \
            chmod a+r include/$$realfile; \
          fi; \
        done
--- 2152,2158 ----
            realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
            touch include/$$realfile; \
            rm -f include/$$realfile; \
!           cp $$file include/.; \
            chmod a+r include/$$realfile; \
          fi; \
        done



More information about the Gcc-patches mailing list