Makefile 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # Makefile for GNU C compiler.
  2. # Copyright (C) 1987 Free Software Foundation, Inc.
  3. #This file is part of GNU CC.
  4. #GNU CC is distributed in the hope that it will be useful,
  5. #but WITHOUT ANY WARRANTY. No author or distributor
  6. #accepts responsibility to anyone for the consequences of using it
  7. #or for whether it serves any particular purpose or works at all,
  8. #unless he says so in writing. Refer to the GNU CC General Public
  9. #License for full details.
  10. #Everyone is granted permission to copy, modify and redistribute
  11. #GNU CC, but only under the conditions described in the
  12. #GNU CC General Public License. A copy of this license is
  13. #supposed to have been given to you along with GNU CC so you
  14. #can know your rights and responsibilities. It should be in a
  15. #file named COPYING. Among other things, the copyright notice
  16. #and this notice must be preserved on all copies.
  17. CFLAGS = -g -I.
  18. CC = cc
  19. # How to link with obstack
  20. OBSTACK=obstack.o
  21. # Dependency on obstack
  22. OBSTACK1=obstack.o
  23. LIBS = $(OBSTACK) $(CLIB)
  24. DIR = ../gcc
  25. OBJS = toplev.o parse.tab.o tree.o print-tree.o \
  26. decl.o typecheck.o stor-layout.o fold-const.o \
  27. varasm.o rtl.o expr.o stmt.o expmed.o explow.o optabs.o \
  28. symout.o dbxout.o emit-rtl.o insn-emit.o \
  29. jump.o cse.o loop.o flow.o stupid.o combine.o \
  30. regclass.o local-alloc.o global-alloc.o reload.o reload1.o \
  31. final.o recog.o insn-recog.o insn-extract.o insn-output.o
  32. # If you want to recompile everything, just do rm *.o.
  33. # CONFIG_H = config.h tm.h
  34. CONFIG_H =
  35. RTL_H = rtl.h rtl.def machmode.def
  36. TREE_H = tree.h tree.def machmode.def
  37. all: gcc cc1 cpp
  38. gcc: gcc.o $(OBSTACK1)
  39. ld -o gcc /lib/crt0.o gcc.o -lg $(LIBS) -lc
  40. gcc.o: gcc.c $(CONFIG)
  41. $(CC) -c $(CFLAGS) gcc.c
  42. cc1: $(OBJS) $(OBSTACK1)
  43. ld -o cc1 /lib/crt0.o $(OBJS) -lg $(LIBS) -lc
  44. ccprof: $(OBJS) $(OBSTACK1)
  45. ld -o cc1 /usr/lib/gcrt0.o $(OBJS) -lg $(OBSTACK) /usr/lib/libc_p.a -lc
  46. decl.o : decl.c $(CONFIG_H) $(TREE_H) parse.h c-tree.h
  47. typecheck.o : typecheck.c $(CONFIG_H) $(TREE_H) c-tree.h
  48. tree.o : tree.c $(CONFIG_H) $(TREE_H)
  49. print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
  50. stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H)
  51. fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H)
  52. toplev.o : toplev.c $(CONFIG_H) $(TREE_H)
  53. varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H)
  54. parse.tab.o : parse.tab.c $(CONFIG_H) $(TREE_H) parse.h c-tree.h
  55. parse.tab.c : parse.y
  56. bison -v parse.y
  57. rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
  58. stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) insn-flags.h stupid.h
  59. expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) insn-flags.h insn-codes.h expr.h
  60. expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) insn-flags.h insn-codes.h expr.h
  61. explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) expr.h
  62. optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) insn-flags.h insn-codes.h expr.h insn-config.h recog.h
  63. symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h
  64. dbxout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h
  65. emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h recog.h insn-config.h
  66. jump.o : jump.c $(CONFIG_H) $(RTL_H)
  67. stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h stupid.h
  68. cse.o : cse.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h
  69. loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h recog.h
  70. flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h
  71. combine.o : combine.c $(CONFIG_H) $(RTL_H) insn-config.h regs.h basic-block.h recog.h
  72. regclass.o : regclass.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h recog.h
  73. local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h
  74. global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h insn-config.h
  75. reload.o : reload.c $(CONFIG_H) $(RTL_H) reload.h recog.h hard-reg-set.h insn-config.h regs.h
  76. reload1.o : reload1.c $(CONFIG_H) $(RTL_H) reload.h regs.h hard-reg-set.h insn-config.h basic-block.h
  77. final.o : final.c $(CONFIG_H) $(RTL_H) regs.h recog.h conditions.h
  78. recog.o : recog.c $(CONFIG_H) $(RTL_H) regs.h recog.h hard-reg-set.h insn-config.h
  79. # Now the source files that are generated from the machine description.
  80. insn-config.h : md genconfig
  81. genconfig md > insn-config.h
  82. insn-flags.h : md genflags
  83. genflags md > insn-flags.h
  84. insn-codes.h : md gencodes
  85. gencodes md > insn-codes.h
  86. insn-emit.o : insn-emit.c $(RTL_H) insn-config.h
  87. $(CC) -c $(CFLAGS) insn-emit.c
  88. insn-emit.c : md genemit
  89. genemit md > insn-emit.c
  90. insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h
  91. $(CC) -c $(CFLAGS) insn-recog.c
  92. insn-recog.c : md genrecog
  93. genrecog md > insn-recog.c
  94. insn-extract.o : insn-extract.c $(RTL_H)
  95. $(CC) -c $(CFLAGS) insn-extract.c
  96. insn-extract.c : md genextract
  97. genextract md > insn-extract.c
  98. insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h insn-flags.h conditions.h aux-output.c
  99. $(CC) -c $(CFLAGS) insn-output.c
  100. insn-output.c : md genoutput
  101. genoutput md > insn-output.c
  102. # Now the programs that generate those files.
  103. # rtl.o is omitted as a dependency so that rtl.c can be recompiled
  104. # to fix its tables without forcing us to regenerate insn-*.c
  105. # and recompile them and regenerate insn-flags.h and recompile
  106. # everything that depends on it.
  107. genconfig : genconfig.o $(OBSTACK1)
  108. $(CC) -o genconfig -g genconfig.o rtl.o $(LIBS)
  109. genconfig.o : genconfig.c rtl.def
  110. $(CC) -c $(CFLAGS) genconfig.c
  111. genflags : genflags.o $(OBSTACK1)
  112. $(CC) -o genflags -g genflags.o rtl.o $(LIBS)
  113. genflags.o : genflags.c rtl.def
  114. $(CC) -c $(CFLAGS) genflags.c
  115. gencodes : gencodes.o $(OBSTACK1)
  116. $(CC) -o gencodes -g gencodes.o rtl.o $(LIBS)
  117. gencodes.o : gencodes.c rtl.def
  118. $(CC) -c $(CFLAGS) gencodes.c
  119. genemit : genemit.o $(OBSTACK1)
  120. $(CC) -o genemit -g genemit.o rtl.o $(LIBS)
  121. genemit.o : genemit.c rtl.def
  122. $(CC) -c $(CFLAGS) genemit.c
  123. genrecog : genrecog.o $(OBSTACK1)
  124. $(CC) -o genrecog -g genrecog.o rtl.o $(LIBS)
  125. genrecog.o : genrecog.c rtl.def
  126. $(CC) -c $(CFLAGS) genrecog.c
  127. genextract : genextract.o $(OBSTACK1)
  128. $(CC) -o genextract -g genextract.o rtl.o $(LIBS)
  129. genextract.o : genextract.c rtl.def
  130. $(CC) -c $(CFLAGS) genextract.c
  131. genoutput : genoutput.o $(OBSTACK1)
  132. $(CC) -o genoutput -g genoutput.o rtl.o $(LIBS)
  133. genoutput.o : genoutput.c rtl.def
  134. $(CC) -c $(CFLAGS) genoutput.c
  135. # Making the preprocessor
  136. cpp: cccp
  137. -rm -f cpp
  138. ln cccp cpp
  139. cccp: cccp.o y.tab.o
  140. cc -o cccp -g cccp.o y.tab.o
  141. y.tab.o: y.tab.c
  142. y.tab.c: cexp.y
  143. echo expect 40 shift/reduce conflicts
  144. yacc cexp.y
  145. cccp.o: cccp.c
  146. clean:
  147. -rm *.o
  148. -rm parse.tab.c insn-flags.h insn-config.h insn-codes.h
  149. -rm insn-output.c insn-recog.c insn-emit.c insn-extract.c
  150. -rm genemit genoutput genrecog genextract genflags gencodes genconfig
  151. -rm *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
  152. -rm parse.output core
  153. # do make -f ../gcc/Makefile maketest DIR=../gcc
  154. # in the intended test directory to make it a suitable test directory.
  155. maketest:
  156. ln -s $(DIR)/*.[chy] .
  157. ln -s $(DIR)/*.def .
  158. ln -s $(DIR)/*.md .
  159. ln -s $(DIR)/.gdbinit .
  160. -ln -s $(DIR)/bison.simple .
  161. ln -s $(DIR)/gcc .
  162. ln -s $(DIR)/Makefile test-Makefile
  163. -rm tm.h aux-output.c
  164. make -f test-Makefile clean
  165. # You must create the necessary links tm.h, md and aux-output.c