makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #
  2. ## $Id: makefile,v 1.3 1997/10/13 22:10:45 roberto Exp roberto $
  3. ## Makefile
  4. ## See Copyright Notice in lua.h
  5. #
  6. #CONFIGURATION
  7. # define (undefine) POPEN if your system (does not) support piped I/O
  8. #
  9. # define (undefine) _POSIX_SOURCE if your system is (not) POSIX compliant
  10. #
  11. # define (undefine) OLD_ANSI if your system does NOT have some new ANSI
  12. # facilities ("strerror" and "locale.h"). Although they are ANSI,
  13. # SunOS does not comply; so, add "-DOLD_ANSI" on SunOS
  14. #
  15. # define LUA_COMPAT2_5=0 if yous system does not need to be compatible with
  16. # version 2.5 (or older)
  17. CONFIG = -DPOPEN -D_POSIX_SOURCE
  18. #CONFIG = -DLUA_COMPAT2_5=0 -DOLD_ANSI -DDEBUG
  19. # Compilation parameters
  20. CC = gcc
  21. CWARNS = -Wall -Wmissing-prototypes -Wshadow -pedantic -Wpointer-arith -Wcast-align -Waggregate-return
  22. CFLAGS = $(CONFIG) $(CWARNS) -ansi -O2
  23. AR = ar
  24. ARFLAGS = rvl
  25. # Aplication modules
  26. LUAOBJS = \
  27. lapi.o \
  28. lauxlib.o \
  29. lbuiltin.o \
  30. ldo.o \
  31. lfunc.o \
  32. lgc.o \
  33. llex.o \
  34. lmem.o \
  35. lobject.o \
  36. lstx.o \
  37. lstring.o \
  38. ltable.o \
  39. ltm.o \
  40. lvm.o \
  41. lundump.o \
  42. lzio.o
  43. LIBOBJS = \
  44. liolib.o \
  45. lmathlib.o \
  46. lstrlib.o
  47. lua : lua.o liblua.a liblualib.a
  48. $(CC) $(CFLAGS) -o $@ lua.o -L. -llua -llualib -lm
  49. liblua.a : $(LUAOBJS)
  50. $(AR) $(ARFLAGS) $@ $?
  51. ranlib $@
  52. liblualib.a : $(LIBOBJS)
  53. $(AR) $(ARFLAGS) $@ $?
  54. ranlib $@
  55. liblua.so.1.0 : lua.o
  56. ld -o liblua.so.1.0 $(LUAOBJS)
  57. lstx.c lstx.h : lua.stx
  58. bison -o lstx.c -p luaY_ -d lua.stx
  59. # yacc -d lua.stx
  60. # sed -e 's/yy/luaY_/g' -e 's/malloc\.h/stdlib\.h/g' y.tab.c > lstx.c
  61. # sed -e 's/yy/luaY_/g' y.tab.h > lstx.h
  62. clear :
  63. rcsclean
  64. rm -f *.o
  65. rm -f lstx.c lstx.h
  66. co lua.h lualib.h luadebug.h
  67. %.h : RCS/%.h,v
  68. co $@
  69. %.c : RCS/%.c,v
  70. co $@
  71. lapi.o: lapi.c lapi.h lua.h lobject.h lauxlib.h ldo.h lfunc.h lgc.h \
  72. lmem.h lstring.h ltable.h ltm.h luadebug.h lvm.h
  73. lauxlib.o: lauxlib.c lauxlib.h lua.h luadebug.h
  74. lbuiltin.o: lbuiltin.c lapi.h lua.h lobject.h lauxlib.h lbuiltin.h \
  75. ldo.h lfunc.h lmem.h lstring.h ltable.h ltm.h
  76. ldo.o: ldo.c lbuiltin.h ldo.h lobject.h lua.h lfunc.h lgc.h lmem.h \
  77. lparser.h lzio.h ltm.h luadebug.h lundump.h lvm.h
  78. lfunc.o: lfunc.c lfunc.h lobject.h lua.h lmem.h
  79. lgc.o: lgc.c ldo.h lobject.h lua.h lfunc.h lgc.h lmem.h lstring.h \
  80. ltable.h ltm.h
  81. liolib.o: liolib.c lauxlib.h lua.h luadebug.h lualib.h
  82. llex.o: llex.c llex.h lobject.h lua.h lzio.h lmem.h lparser.h \
  83. lstring.h lstx.h luadebug.h
  84. lmathlib.o: lmathlib.c lauxlib.h lua.h lualib.h
  85. lmem.o: lmem.c lmem.h lua.h
  86. lobject.o: lobject.c lobject.h lua.h
  87. lstring.o: lstring.c lmem.h lobject.h lua.h lstring.h
  88. lstrlib.o: lstrlib.c lauxlib.h lua.h lualib.h
  89. lstx.o: lstx.c lauxlib.h lua.h ldo.h lobject.h lfunc.h llex.h lzio.h \
  90. lmem.h lopcodes.h lparser.h lstring.h luadebug.h
  91. ltable.o: ltable.c lauxlib.h lua.h lmem.h lobject.h ltable.h
  92. ltm.o: ltm.c lauxlib.h lua.h ldo.h lobject.h lmem.h ltm.h lapi.h
  93. lua.o: lua.c lua.h luadebug.h lualib.h
  94. lundump.o: lundump.c lauxlib.h lua.h lfunc.h lobject.h lmem.h \
  95. lstring.h lundump.h lzio.h
  96. lvm.o: lvm.c lauxlib.h lua.h ldo.h lobject.h lfunc.h lgc.h lmem.h \
  97. lopcodes.h lstring.h ltable.h ltm.h luadebug.h lvm.h
  98. lzio.o: lzio.c lzio.h