--- gcc/Makefile 2018/04/24 16:42:51 1.1.1.7 +++ gcc/Makefile 2018/04/24 16:47:30 1.1.1.11 @@ -31,7 +31,7 @@ bindir = /usr/local libdir = /usr/local/lib # These are what you would need on HPUX: -# CFLAGS = -Wc,-Ns2000 -Wc,-Ne700 +# CFLAGS = -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300 # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5 # bites whenever tree.def, rtl.def or machmode.def is included # (ie., on every source file). @@ -93,7 +93,10 @@ LIBFUNCS = _eprintf \ _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 _cmpdf2 \ _fixunsdfsi _fixunsdfdi _fixdfsi _fixdfdi \ _floatsidf _floatdidf _truncdfsf2 _extendsfdf2 \ - _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3 + _addsf3 _negsf2 _subsf3 _cmpsf2 _mulsf3 _divsf3 _varargs + +# Header files that are made available to programs compiled with gcc. +USER_H = stddef.h stdarg.h assert.h varargs.h va-*.h limits.h # If you want to recompile everything, just do rm *.o. # CONFIG_H = config.h tm.h @@ -103,7 +106,7 @@ TREE_H = tree.h tree.def machmode.def all: gnulib gcc cc1 cpp -doc: cpp.info internals +doc: cpp.info gcc.info compilations: ${OBJS} @@ -128,7 +131,7 @@ gnulib: gnulib.c do \ echo $${name}; \ rm -f $${name}.c; \ - ln ../gnulib.c $${name}.c; \ + cp ../gnulib.c $${name}.c; \ $(OLDCC) $(CCLIBFLAGS) -O -I.. -c -DL$${name} $${name}.c; \ $(AR) qc gnulib $${name}.o; \ done @@ -184,8 +187,8 @@ integrate.o : integrate.c $(CONFIG_H) $( jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h -cse.o : cse.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h hard-reg-set.h -loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h recog.h +cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h +loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h recog.h flags.h expr.h flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \ insn-config.h regs.h basic-block.h recog.h @@ -324,7 +327,7 @@ cccp.o: cccp.c cpp.info: cpp.texinfo makeinfo $< -internals: internals.texinfo +gcc.info: gcc.texinfo makeinfo $< # gnulib is not deleted because deleting it would be inconvenient @@ -334,6 +337,12 @@ clean: -rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop -rm -f core +# Get rid of every file that's generated from some other file (except INSTALL). +realclean: clean + -rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs + -rm -f c-parse.tab.c c-parse.output errs gnulib cexp.c TAGS + -rm -f internals internals-* internals.?? internals.??s + # Copy the files into directories where they will be run. install: all install cc1 $(libdir)/gcc-cc1 @@ -342,7 +351,8 @@ install: all install cpp $(libdir)/gcc-cpp install gcc $(bindir) -mkdir $(libdir)/gcc-include - cp stddef.h stdarg.h assert.h varargs.h limits.h $(libdir)/gcc-include + cd $(libdir)/gcc-include; rm -f $(USER_H) + cp $(USER_H) $(libdir)/gcc-include # do make -f ../gcc/Makefile maketest DIR=../gcc # in the intended test directory to make it a suitable test directory. @@ -350,34 +360,49 @@ maketest: ln -s $(DIR)/*.[chy] . ln -s $(DIR)/*.def . ln -s $(DIR)/*.md . + -rm -f =* ln -s $(DIR)/.gdbinit . -ln -s $(DIR)/bison.simple . - ln -s $(DIR)/gcc . + ln -s $(DIR)/config.gcc . ln -s $(DIR)/move-if-change . - ln -s $(DIR)/Makefile test-Makefile - -rm tm.h aux-output.c - make -f test-Makefile clean -# You must create the necessary links tm.h, md and aux-output.c + if [ -f Makefile ] ; then false; else ln -s $(DIR)/Makefile . ; fi + -rm tm.h aux-output.c config.h md + make clean +# You must then run config.gcc to set up for compilation. + +bootstrap: all force + $(MAKE) stage1 + $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="-O $(CFLAGS)" + $(MAKE) stage2 + $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="-O $(CFLAGS)" # Copy the object files from a particular stage into a subdirectory. stage1: force -mkdir stage1 mv $(STAGESTUFF) $(STAGE_GCC) stage1 - ln gnulib stage1 + -rm -f stage1/gnulib + -ln gnulib stage1 || cp gnulib stage1 stage2: force -mkdir stage2 mv $(STAGESTUFF) $(STAGE_GCC) stage2 - ln gnulib stage2 + -rm -f stage2/gnulib + -ln gnulib stage2 || cp gnulib stage2 stage3: force -mkdir stage3 mv $(STAGESTUFF) $(STAGE_GCC) stage3 - ln gnulib stage3 - -.PHONY: stage1 stage2 stage3 #In GNU Make, ignore whether `stage*' exists. -force: + -rm -f stage3/gnulib + -ln gnulib stage3 || cp gnulib stage3 TAGS: force + mkdir temp + -mv c-parse.tab.c cexp.c temp etags *.y *.h *.c -.PHONY: TAGS + mv temp/* . + rmdir temp + +#In GNU Make, ignore whether `stage*' exists. +.PHONY: stage1 stage2 stage3 clean realclean TAGS bootstrap + +force: