Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #
  2. EMHOME = ../../..
  3. MHDIR = $(EMHOME)/modules/h
  4. PKGDIR = $(EMHOME)/modules/pkg
  5. LIBDIR = $(EMHOME)/modules/lib
  6. LLGEN = $(EMHOME)/bin/LLgen
  7. MKDEP = $(EMHOME)/bin/mkdep
  8. INCLUDES = -I$(MHDIR) -I$(PKGDIR) -I$(EMHOME)/h
  9. GF = program.g declar.g expression.g statement.g
  10. GENGFILES= tokenfile.g
  11. GFILES =$(GENGFILES) $(GF)
  12. LLGENOPTIONS = -v
  13. PROFILE =
  14. CFLAGS = $(PROFILE) $(INCLUDES) -DSTATIC=
  15. LINTFLAGS = -DSTATIC= -DNORCSID
  16. MALLOC = $(LIBDIR)/malloc.o
  17. LDFLAGS = -i $(PROFILE)
  18. LSRC = tokenfile.c program.c declar.c expression.c statement.c
  19. LOBJ = tokenfile.o program.o declar.o expression.o statement.o
  20. CSRC = LLlex.c LLmessage.c error.c main.c lib.c \
  21. tokenname.c idf.c input.c misc.c options.c
  22. COBJ = LLlex.o LLmessage.o error.o main.o lib.o \
  23. tokenname.o idf.o input.o misc.o options.o char.o symbol2str.o
  24. GENC= $(LSRC) symbol2str.c char.c Lpars.c
  25. SRC = $(CSRC) $(GENC)
  26. OBJ = $(COBJ) $(LOBJ) Lpars.o
  27. GENH = Lpars.h
  28. HSRC = main.h LLlex.h class.h f_info.h idf.h input.h tokenname.h
  29. HFILES =$(GENH) $(HSRC)
  30. #
  31. GENFILES = $(GENGFILES) $(GENC) $(GENH)
  32. all: Cfiles
  33. make "EMHOME="$(EMHOME) m2mm
  34. install: all
  35. cp m2mm $(EMHOME)/bin
  36. cp m2mm.1 $(EMHOME)/man
  37. cmp: all
  38. -cmp m2mm $(EMHOME)/bin/m2mm
  39. -cmp m2mm.1 $(EMHOME)/man/m2mm.1
  40. opr:
  41. make "EMHOME="$(EMHOME) pr | opr
  42. pr:
  43. @pr Makefile $(GF) $(HFILES) $(CSRC)
  44. clean:
  45. rm -f $(OBJ) $(GENFILES) LLfiles Cfiles tab LL.output m2mm
  46. lint: Cfiles
  47. lint $(INCLUDES) $(LINTFLAGS) $(SRC) \
  48. $(LIBDIR)/llib-linput.ln \
  49. $(LIBDIR)/llib-lalloc.ln \
  50. $(LIBDIR)/llib-lprint.ln \
  51. $(LIBDIR)/llib-lstring.ln \
  52. $(LIBDIR)/llib-lsystem.ln
  53. # entry points not to be used directly
  54. Cfiles: LLfiles $(GENC) $(GENH) Makefile
  55. LLfiles: $(GFILES)
  56. $(LLGEN) $(LLGENOPTIONS) $(GFILES)
  57. @touch LLfiles
  58. tokenfile.g: tokenname.c make.tokfile
  59. make.tokfile <tokenname.c >tokenfile.g
  60. symbol2str.c: tokenname.c make.tokcase
  61. make.tokcase <tokenname.c >symbol2str.c
  62. char.c: char.tab tab
  63. tab -fchar.tab >char.c
  64. tab:
  65. $(CC) tab.c -o tab
  66. depend: Cfiles
  67. sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new
  68. echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new
  69. $(MKDEP) $(SRC) |\
  70. sed 's/\.c:/\.o:/' >> Makefile.new
  71. mv Makefile Makefile.old
  72. mv Makefile.new Makefile
  73. m2mm: $(OBJ)
  74. $(CC) $(LDFLAGS) $(OBJ) $(LIBDIR)/libinput.a $(LIBDIR)/liballoc.a $(MALLOC) $(LIBDIR)/libprint.a $(LIBDIR)/libstring.a $(LIBDIR)/libsystem.a -o m2mm
  75. size m2mm
  76. #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
  77. LLlex.o: LLlex.h
  78. LLlex.o: Lpars.h
  79. LLlex.o: class.h
  80. LLlex.o: f_info.h
  81. LLlex.o: file_list.h
  82. LLlex.o: idf.h
  83. LLlex.o: idfsize.h
  84. LLlex.o: input.h
  85. LLlex.o: inputtype.h
  86. LLmessage.o: LLlex.h
  87. LLmessage.o: Lpars.h
  88. LLmessage.o: file_list.h
  89. LLmessage.o: idf.h
  90. error.o: LLlex.h
  91. error.o: f_info.h
  92. error.o: input.h
  93. error.o: inputtype.h
  94. main.o: LLlex.h
  95. main.o: Lpars.h
  96. main.o: f_info.h
  97. main.o: file_list.h
  98. main.o: idf.h
  99. main.o: input.h
  100. main.o: inputtype.h
  101. main.o: tokenname.h
  102. tokenname.o: Lpars.h
  103. tokenname.o: file_list.h
  104. tokenname.o: idf.h
  105. tokenname.o: tokenname.h
  106. idf.o: file_list.h
  107. idf.o: idf.h
  108. input.o: f_info.h
  109. input.o: input.h
  110. input.o: inputtype.h
  111. misc.o: LLlex.h
  112. misc.o: f_info.h
  113. misc.o: file_list.h
  114. misc.o: idf.h
  115. options.o: main.h
  116. tokenfile.o: Lpars.h
  117. program.o: LLlex.h
  118. program.o: Lpars.h
  119. program.o: f_info.h
  120. program.o: file_list.h
  121. program.o: idf.h
  122. program.o: main.h
  123. declar.o: Lpars.h
  124. expression.o: Lpars.h
  125. statement.o: LLlex.h
  126. statement.o: Lpars.h
  127. statement.o: file_list.h
  128. statement.o: idf.h
  129. symbol2str.o: Lpars.h
  130. char.o: class.h
  131. Lpars.o: Lpars.h