makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # $Id: makefile,v 1.30 1997/03/31 14:17:09 roberto Exp roberto $
  2. #configuration
  3. # define (undefine) POPEN if your system (does not) support piped I/O
  4. # define (undefine) _POSIX_SOURCE if your system is (not) POSIX compliant
  5. #define (undefine) NOSTRERROR if your system does NOT have function "strerror"
  6. # (although this is ANSI, SunOS does not comply; so, add "-DNOSTRERROR" on SunOS)
  7. CONFIG = -DPOPEN -D_POSIX_SOURCE
  8. # Compilation parameters
  9. CC = gcc
  10. CFLAGS = $(CONFIG) -Wall -Wmissing-prototypes -Wshadow -ansi -O2 -pedantic
  11. #CC = acc
  12. #CFLAGS = -fast -I/usr/5include
  13. AR = ar
  14. ARFLAGS = rvl
  15. # Aplication modules
  16. LUAOBJS = \
  17. parser.o \
  18. lex.o \
  19. opcode.o \
  20. hash.o \
  21. table.o \
  22. inout.o \
  23. tree.o \
  24. fallback.o \
  25. luamem.o \
  26. func.o \
  27. undump.o \
  28. auxlib.o
  29. LIBOBJS = \
  30. iolib.o \
  31. mathlib.o \
  32. strlib.o
  33. lua : lua.o liblua.a liblualib.a
  34. $(CC) $(CFLAGS) -o $@ lua.o -L. -llua -llualib -lm
  35. liblua.a : $(LUAOBJS)
  36. $(AR) $(ARFLAGS) $@ $?
  37. ranlib $@
  38. liblualib.a : $(LIBOBJS)
  39. $(AR) $(ARFLAGS) $@ $?
  40. ranlib $@
  41. liblua.so.1.0 : lua.o
  42. ld -o liblua.so.1.0 $(LUAOBJS)
  43. y.tab.c y.tab.h : lua.stx
  44. yacc -d lua.stx
  45. parser.c : y.tab.c
  46. sed -e 's/yy/luaY_/g' -e 's/malloc\.h/stdlib\.h/g' y.tab.c > parser.c
  47. parser.h : y.tab.h
  48. sed -e 's/yy/luaY_/g' y.tab.h > parser.h
  49. clear :
  50. rcsclean
  51. rm -f *.o
  52. rm -f parser.c parser.h y.tab.c y.tab.h
  53. co lua.h lualib.h luadebug.h
  54. %.h : RCS/%.h,v
  55. co $@
  56. %.c : RCS/%.c,v
  57. co $@
  58. auxlib.o: auxlib.c lua.h auxlib.h
  59. fallback.o: fallback.c auxlib.h lua.h luamem.h fallback.h opcode.h \
  60. types.h tree.h func.h table.h hash.h
  61. func.o: func.c luadebug.h lua.h table.h tree.h types.h opcode.h func.h \
  62. luamem.h
  63. hash.o: hash.c luamem.h opcode.h lua.h types.h tree.h func.h hash.h \
  64. table.h
  65. inout.o: inout.c auxlib.h lua.h lex.h opcode.h types.h tree.h func.h \
  66. inout.h table.h hash.h luamem.h fallback.h
  67. iolib.o: iolib.c lua.h auxlib.h luadebug.h lualib.h
  68. lex.o: lex.c auxlib.h lua.h luamem.h tree.h types.h table.h opcode.h \
  69. func.h lex.h inout.h luadebug.h parser.h
  70. lua.o: lua.c lua.h lualib.h
  71. luamem.o: luamem.c luamem.h lua.h
  72. mathlib.o: mathlib.c lualib.h lua.h auxlib.h
  73. opcode.o: opcode.c luadebug.h lua.h luamem.h opcode.h types.h tree.h \
  74. func.h hash.h inout.h table.h fallback.h undump.h
  75. parser.o: parser.c luadebug.h lua.h luamem.h lex.h opcode.h types.h \
  76. tree.h func.h hash.h inout.h table.h
  77. strlib.o: strlib.c lua.h auxlib.h lualib.h
  78. table.o: table.c luamem.h opcode.h lua.h types.h tree.h func.h hash.h \
  79. table.h inout.h fallback.h luadebug.h
  80. tree.o: tree.c luamem.h lua.h tree.h types.h lex.h hash.h opcode.h \
  81. func.h table.h fallback.h
  82. undump.o: undump.c opcode.h lua.h types.h tree.h func.h luamem.h \
  83. table.h undump.h