makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # $Id: makefile,v 1.32 1997/03/31 20:58:42 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. CWARNS = -Wall -Wmissing-prototypes -Wshadow -pedantic -Wpointer-arith -Wcast-align -Waggregate-return
  11. CFLAGS = $(CONFIG) $(CWARNS) -ansi -O2 -fomit-frame-pointer
  12. #CC = acc
  13. #CFLAGS = -fast -I/usr/5include
  14. AR = ar
  15. ARFLAGS = rvl
  16. # Aplication modules
  17. LUAOBJS = \
  18. parser.o \
  19. lex.o \
  20. opcode.o \
  21. hash.o \
  22. table.o \
  23. inout.o \
  24. tree.o \
  25. fallback.o \
  26. luamem.o \
  27. func.o \
  28. undump.o \
  29. auxlib.o
  30. LIBOBJS = \
  31. iolib.o \
  32. mathlib.o \
  33. strlib.o
  34. lua : lua.o liblua.a liblualib.a
  35. $(CC) $(CFLAGS) -o $@ lua.o -L. -llua -llualib -lm
  36. liblua.a : $(LUAOBJS)
  37. $(AR) $(ARFLAGS) $@ $?
  38. ranlib $@
  39. liblualib.a : $(LIBOBJS)
  40. $(AR) $(ARFLAGS) $@ $?
  41. ranlib $@
  42. liblua.so.1.0 : lua.o
  43. ld -o liblua.so.1.0 $(LUAOBJS)
  44. y.tab.c y.tab.h : lua.stx
  45. yacc -d lua.stx
  46. parser.c : y.tab.c
  47. sed -e 's/yy/luaY_/g' -e 's/malloc\.h/stdlib\.h/g' y.tab.c > parser.c
  48. parser.h : y.tab.h
  49. sed -e 's/yy/luaY_/g' y.tab.h > parser.h
  50. clear :
  51. rcsclean
  52. rm -f *.o
  53. rm -f parser.c parser.h y.tab.c y.tab.h
  54. co lua.h lualib.h luadebug.h
  55. %.h : RCS/%.h,v
  56. co $@
  57. %.c : RCS/%.c,v
  58. co $@
  59. auxlib.o: auxlib.c lua.h auxlib.h
  60. fallback.o: fallback.c auxlib.h lua.h luamem.h fallback.h opcode.h \
  61. types.h tree.h func.h table.h hash.h
  62. func.o: func.c luadebug.h lua.h table.h tree.h types.h opcode.h func.h \
  63. luamem.h
  64. hash.o: hash.c luamem.h opcode.h lua.h types.h tree.h func.h hash.h \
  65. table.h auxlib.h
  66. inout.o: inout.c auxlib.h lua.h lex.h opcode.h types.h tree.h func.h \
  67. inout.h table.h hash.h luamem.h fallback.h
  68. iolib.o: iolib.c lua.h auxlib.h luadebug.h lualib.h
  69. lex.o: lex.c auxlib.h lua.h luamem.h tree.h types.h table.h opcode.h \
  70. func.h lex.h inout.h luadebug.h parser.h
  71. lua.o: lua.c lua.h lualib.h
  72. luamem.o: luamem.c luamem.h lua.h
  73. mathlib.o: mathlib.c lualib.h lua.h auxlib.h
  74. opcode.o: opcode.c luadebug.h lua.h luamem.h opcode.h types.h tree.h \
  75. func.h hash.h inout.h table.h fallback.h undump.h auxlib.h
  76. parser.o: parser.c luadebug.h lua.h luamem.h lex.h opcode.h types.h \
  77. tree.h func.h hash.h inout.h table.h
  78. strlib.o: strlib.c lua.h auxlib.h lualib.h
  79. table.o: table.c luamem.h auxlib.h lua.h opcode.h types.h tree.h \
  80. func.h hash.h table.h inout.h fallback.h luadebug.h
  81. tree.o: tree.c luamem.h lua.h tree.h types.h lex.h hash.h opcode.h \
  82. func.h table.h fallback.h
  83. undump.o: undump.c opcode.h lua.h types.h tree.h func.h luamem.h \
  84. table.h undump.h