makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # $Id: makefile,v 1.36 1997/06/23 18:27:53 roberto Exp roberto $
  2. #configuration
  3. # define (undefine) POPEN if your system (does not) support piped I/O
  4. #
  5. # define (undefine) _POSIX_SOURCE if your system is (not) POSIX compliant
  6. #
  7. # define (undefine) OLD_ANSI if your system does NOT have some new ANSI
  8. # facilities ("strerror" and "locale.h"). Although they are ANSI,
  9. # SunOS does not comply; so, add "-DOLD_ANSI" on SunOS
  10. #
  11. # define LUA_COMPAT2_5=0 if yous system does not need to be compatible with
  12. # version 2.5 (or older)
  13. CONFIG = -DPOPEN -D_POSIX_SOURCE
  14. # Compilation parameters
  15. CC = gcc
  16. CWARNS = -Wall -Wmissing-prototypes -Wshadow -pedantic -Wpointer-arith -Wcast-align -Waggregate-return
  17. CFLAGS = $(CONFIG) $(CWARNS) -ansi -O2
  18. #CC = acc
  19. #CFLAGS = -fast -I/usr/5include
  20. AR = ar
  21. ARFLAGS = rvl
  22. # Aplication modules
  23. LUAOBJS = \
  24. parser.o \
  25. lex.o \
  26. opcode.o \
  27. hash.o \
  28. table.o \
  29. inout.o \
  30. tree.o \
  31. fallback.o \
  32. luamem.o \
  33. func.o \
  34. undump.o \
  35. auxlib.o \
  36. zio.o
  37. LIBOBJS = \
  38. iolib.o \
  39. mathlib.o \
  40. strlib.o
  41. lua : lua.o liblua.a liblualib.a
  42. $(CC) $(CFLAGS) -o $@ lua.o -L. -llua -llualib -lm
  43. liblua.a : $(LUAOBJS)
  44. $(AR) $(ARFLAGS) $@ $?
  45. ranlib $@
  46. liblualib.a : $(LIBOBJS)
  47. $(AR) $(ARFLAGS) $@ $?
  48. ranlib $@
  49. liblua.so.1.0 : lua.o
  50. ld -o liblua.so.1.0 $(LUAOBJS)
  51. y.tab.c y.tab.h : lua.stx
  52. yacc -d lua.stx
  53. parser.c : y.tab.c
  54. sed -e 's/yy/luaY_/g' -e 's/malloc\.h/stdlib\.h/g' y.tab.c > parser.c
  55. parser.h : y.tab.h
  56. sed -e 's/yy/luaY_/g' y.tab.h > parser.h
  57. clear :
  58. rcsclean
  59. rm -f *.o
  60. rm -f parser.c parser.h y.tab.c y.tab.h
  61. co lua.h lualib.h luadebug.h
  62. %.h : RCS/%.h,v
  63. co $@
  64. %.c : RCS/%.c,v
  65. co $@
  66. auxlib.o: auxlib.c lua.h auxlib.h luadebug.h
  67. fallback.o: fallback.c auxlib.h lua.h luamem.h fallback.h opcode.h \
  68. types.h tree.h func.h table.h hash.h
  69. func.o: func.c luadebug.h lua.h table.h tree.h types.h opcode.h func.h \
  70. luamem.h
  71. hash.o: hash.c luamem.h opcode.h lua.h types.h tree.h func.h hash.h \
  72. table.h auxlib.h
  73. inout.o: inout.c auxlib.h lua.h fallback.h opcode.h types.h tree.h \
  74. func.h hash.h inout.h lex.h zio.h luamem.h table.h undump.h
  75. iolib.o: iolib.c lua.h auxlib.h luadebug.h lualib.h lualoc.h
  76. lex.o: lex.c auxlib.h lua.h luamem.h tree.h types.h table.h opcode.h \
  77. func.h lex.h zio.h inout.h luadebug.h parser.h
  78. lua.o: lua.c lua.h auxlib.h lualib.h lualoc.h
  79. luamem.o: luamem.c luamem.h lua.h
  80. mathlib.o: mathlib.c lualib.h lua.h auxlib.h
  81. opcode.o: opcode.c luadebug.h lua.h luamem.h opcode.h types.h tree.h \
  82. func.h hash.h inout.h table.h fallback.h auxlib.h lex.h zio.h lualoc.h
  83. parser.o: parser.c luadebug.h lua.h luamem.h lex.h zio.h opcode.h \
  84. types.h tree.h func.h hash.h inout.h table.h
  85. strlib.o: strlib.c lua.h auxlib.h lualib.h
  86. table.o: table.c luamem.h auxlib.h lua.h func.h types.h tree.h \
  87. opcode.h hash.h table.h inout.h fallback.h luadebug.h
  88. tree.o: tree.c luamem.h lua.h tree.h types.h lex.h zio.h hash.h \
  89. opcode.h func.h table.h fallback.h
  90. undump.o: undump.c auxlib.h lua.h opcode.h types.h tree.h func.h \
  91. luamem.h table.h undump.h zio.h
  92. y.tab.o: y.tab.c luadebug.h lua.h luamem.h lex.h zio.h opcode.h \
  93. types.h tree.h func.h hash.h inout.h table.h
  94. zio.o: zio.c zio.h