proto.make 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. # $Header$
  2. #PARAMS do not remove this line!
  3. #MACH_DEFINE do not remove this or the next line!
  4. MACH =
  5. SRC_DIR = $(SRC_HOME)/mach/$(MACH)/cg
  6. CDIR=$(SRC_HOME)/mach/proto/cg
  7. LIBEM = $(TARGET_HOME)/lib.bin/em_data.$(LIBSUF)
  8. LIBFLT = $(TARGET_HOME)/modules/lib/libflt.$(LIBSUF)
  9. CPP = $(UTIL_HOME)/lib.bin/cpp
  10. CGG = $(UTIL_HOME)/lib.bin/cgg
  11. PREFLAGS=-I$(TARGET_HOME)/h -I$(SRC_HOME)/mach -I$(TARGET_HOME)/modules/h -I$(SRC_DIR) -I. -I$(CDIR) -DNDEBUG
  12. PFLAGS=
  13. CFLAGS=$(PREFLAGS) $(PFLAGS) $(COPTIONS)
  14. LDFLAGS=$(PFLAGS) $(LDOPTIONS)
  15. LINTFLAGS=$(PREFLAGS) $(LINTOPTIONS)
  16. LIBS=$(LIBEM) $(LIBFLT)
  17. CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
  18. $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
  19. $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
  20. $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
  21. OFILES= codegen.$(SUF) compute.$(SUF) equiv.$(SUF) fillem.$(SUF) \
  22. gencode.$(SUF) glosym.$(SUF) main.$(SUF) move.$(SUF) nextem.$(SUF) \
  23. reg.$(SUF) regvar.$(SUF) salloc.$(SUF) state.$(SUF) subr.$(SUF) \
  24. var.$(SUF)
  25. all: tables.c
  26. make cg
  27. cg: tables.o $(OFILES)
  28. $(CC) $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
  29. tables.$(SUF): tables.c
  30. $(CC) -c $(PREFLAGS) tables.c
  31. codegen.$(SUF): $(CDIR)/codegen.c
  32. $(CC) -c $(CFLAGS) $(CDIR)/codegen.c
  33. compute.$(SUF): $(CDIR)/compute.c
  34. $(CC) -c $(CFLAGS) $(CDIR)/compute.c
  35. equiv.$(SUF): $(CDIR)/equiv.c
  36. $(CC) -c $(CFLAGS) $(CDIR)/equiv.c
  37. fillem.$(SUF): $(CDIR)/fillem.c
  38. $(CC) -c $(CFLAGS) $(CDIR)/fillem.c
  39. gencode.$(SUF): $(CDIR)/gencode.c
  40. $(CC) -c $(CFLAGS) $(CDIR)/gencode.c
  41. glosym.$(SUF): $(CDIR)/glosym.c
  42. $(CC) -c $(CFLAGS) $(CDIR)/glosym.c
  43. main.$(SUF): $(CDIR)/main.c
  44. $(CC) -c $(CFLAGS) $(CDIR)/main.c
  45. move.$(SUF): $(CDIR)/move.c
  46. $(CC) -c $(CFLAGS) $(CDIR)/move.c
  47. nextem.$(SUF): $(CDIR)/nextem.c
  48. $(CC) -c $(CFLAGS) $(CDIR)/nextem.c
  49. reg.$(SUF): $(CDIR)/reg.c
  50. $(CC) -c $(CFLAGS) $(CDIR)/reg.c
  51. regvar.$(SUF): $(CDIR)/regvar.c
  52. $(CC) -c $(CFLAGS) $(CDIR)/regvar.c
  53. salloc.$(SUF): $(CDIR)/salloc.c
  54. $(CC) -c $(CFLAGS) $(CDIR)/salloc.c
  55. state.$(SUF): $(CDIR)/state.c
  56. $(CC) -c $(CFLAGS) $(CDIR)/state.c
  57. subr.$(SUF): $(CDIR)/subr.c
  58. $(CC) -c $(CFLAGS) $(CDIR)/subr.c
  59. var.$(SUF): $(CDIR)/var.c
  60. $(CC) -c $(CFLAGS) $(CDIR)/var.c
  61. install: all
  62. cp cg $(TARGET_HOME)/lib.bin/$(MACH)/cg
  63. cmp: all
  64. -cmp cg $(TARGET_HOME)/lib.bin/$(MACH)/cg
  65. tables.c: $(SRC_DIR)/table $(CGG)
  66. -mv tables.h tables.h.save
  67. $(CPP) -P -I$(SRC_DIR) $(SRC_DIR)/table | $(CGG) > debug.out
  68. -if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
  69. -if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
  70. lint: tables.c
  71. $(LINT) $(LINTFLAGS) $(CFILES) tables.c
  72. clean:
  73. rm -f *.$(SUF) tables.c tables.h debug.out cg tables.h.save
  74. codegen.$(SUF): $(CDIR)/assert.h
  75. codegen.$(SUF): $(CDIR)/data.h
  76. codegen.$(SUF): $(CDIR)/equiv.h
  77. codegen.$(SUF): $(CDIR)/extern.h
  78. codegen.$(SUF): $(CDIR)/param.h
  79. codegen.$(SUF): $(CDIR)/result.h
  80. codegen.$(SUF): $(CDIR)/state.h
  81. codegen.$(SUF): tables.h
  82. codegen.$(SUF): $(CDIR)/types.h
  83. compute.$(SUF): $(CDIR)/assert.h
  84. compute.$(SUF): $(CDIR)/data.h
  85. compute.$(SUF): $(CDIR)/extern.h
  86. compute.$(SUF): $(CDIR)/glosym.h
  87. compute.$(SUF): $(CDIR)/param.h
  88. compute.$(SUF): $(CDIR)/result.h
  89. compute.$(SUF): tables.h
  90. compute.$(SUF): $(CDIR)/types.h
  91. equiv.$(SUF): $(CDIR)/assert.h
  92. equiv.$(SUF): $(CDIR)/data.h
  93. equiv.$(SUF): $(CDIR)/equiv.h
  94. equiv.$(SUF): $(CDIR)/extern.h
  95. equiv.$(SUF): $(CDIR)/param.h
  96. equiv.$(SUF): $(CDIR)/result.h
  97. equiv.$(SUF): tables.h
  98. equiv.$(SUF): $(CDIR)/types.h
  99. fillem.$(SUF): $(CDIR)/assert.h
  100. fillem.$(SUF): $(CDIR)/data.h
  101. fillem.$(SUF): $(CDIR)/extern.h
  102. fillem.$(SUF): $(SRC_DIR)/mach.c
  103. fillem.$(SUF): $(SRC_DIR)/mach.h
  104. fillem.$(SUF): $(CDIR)/param.h
  105. fillem.$(SUF): $(CDIR)/regvar.h
  106. fillem.$(SUF): $(CDIR)/result.h
  107. fillem.$(SUF): tables.h
  108. fillem.$(SUF): $(CDIR)/types.h
  109. gencode.$(SUF): $(CDIR)/assert.h
  110. gencode.$(SUF): $(CDIR)/data.h
  111. gencode.$(SUF): $(CDIR)/extern.h
  112. gencode.$(SUF): $(CDIR)/param.h
  113. gencode.$(SUF): $(CDIR)/result.h
  114. gencode.$(SUF): tables.h
  115. gencode.$(SUF): $(CDIR)/types.h
  116. glosym.$(SUF): $(CDIR)/glosym.h
  117. glosym.$(SUF): $(CDIR)/param.h
  118. glosym.$(SUF): tables.h
  119. glosym.$(SUF): $(CDIR)/types.h
  120. main.$(SUF): $(CDIR)/param.h
  121. move.$(SUF): $(CDIR)/assert.h
  122. move.$(SUF): $(CDIR)/data.h
  123. move.$(SUF): $(CDIR)/extern.h
  124. move.$(SUF): $(CDIR)/param.h
  125. move.$(SUF): $(CDIR)/result.h
  126. move.$(SUF): tables.h
  127. move.$(SUF): $(CDIR)/types.h
  128. nextem.$(SUF): $(CDIR)/assert.h
  129. nextem.$(SUF): $(CDIR)/data.h
  130. nextem.$(SUF): $(CDIR)/extern.h
  131. nextem.$(SUF): $(CDIR)/param.h
  132. nextem.$(SUF): $(CDIR)/result.h
  133. nextem.$(SUF): tables.h
  134. nextem.$(SUF): $(CDIR)/types.h
  135. reg.$(SUF): $(CDIR)/assert.h
  136. reg.$(SUF): $(CDIR)/data.h
  137. reg.$(SUF): $(CDIR)/extern.h
  138. reg.$(SUF): $(CDIR)/param.h
  139. reg.$(SUF): $(CDIR)/result.h
  140. reg.$(SUF): tables.h
  141. reg.$(SUF): $(CDIR)/types.h
  142. regvar.$(SUF): $(CDIR)/assert.h
  143. regvar.$(SUF): $(CDIR)/data.h
  144. regvar.$(SUF): $(CDIR)/extern.h
  145. regvar.$(SUF): $(CDIR)/param.h
  146. regvar.$(SUF): $(CDIR)/regvar.h
  147. regvar.$(SUF): $(CDIR)/result.h
  148. regvar.$(SUF): tables.h
  149. regvar.$(SUF): $(CDIR)/types.h
  150. salloc.$(SUF): $(CDIR)/assert.h
  151. salloc.$(SUF): $(CDIR)/data.h
  152. salloc.$(SUF): $(CDIR)/extern.h
  153. salloc.$(SUF): $(CDIR)/param.h
  154. salloc.$(SUF): $(CDIR)/result.h
  155. salloc.$(SUF): tables.h
  156. salloc.$(SUF): $(CDIR)/types.h
  157. state.$(SUF): $(CDIR)/assert.h
  158. state.$(SUF): $(CDIR)/data.h
  159. state.$(SUF): $(CDIR)/extern.h
  160. state.$(SUF): $(CDIR)/param.h
  161. state.$(SUF): $(CDIR)/result.h
  162. state.$(SUF): $(CDIR)/state.h
  163. state.$(SUF): tables.h
  164. state.$(SUF): $(CDIR)/types.h
  165. subr.$(SUF): $(CDIR)/assert.h
  166. subr.$(SUF): $(CDIR)/data.h
  167. subr.$(SUF): $(CDIR)/extern.h
  168. subr.$(SUF): $(CDIR)/param.h
  169. subr.$(SUF): $(CDIR)/result.h
  170. subr.$(SUF): tables.h
  171. subr.$(SUF): $(CDIR)/types.h
  172. var.$(SUF): $(CDIR)/data.h
  173. var.$(SUF): $(CDIR)/param.h
  174. var.$(SUF): $(CDIR)/result.h
  175. var.$(SUF): tables.h
  176. var.$(SUF): $(CDIR)/types.h