diff -urN lua-4.1-work4/INSTALL lua-4.1-work4-Makefilepatches/INSTALL --- lua-4.1-work4/INSTALL Wed Aug 29 20:24:44 2001 +++ lua-4.1-work4-Makefilepatches/INSTALL Mon Feb 18 12:07:20 2002 @@ -73,4 +73,19 @@ Of course, to use Lua as a library, you'll have to know how to create and use libraries with your compiler. +* Alternative Windows instructions + -------------------------------- + If you install the cygwin tools (see + http://sources.redhat.com/cygwin/ ), or you have GNU make, you can + use the Lua Makefiles directly to build. The default settings in + "config" should work right away with gcc & cygwin. Just do "make", + like in the Unix instructions above. However, the library and + executable files will be cygwin-dependent (they won't run on + machines that don't have cygwin), and they libraries won't link + easily with programs compiled with Windows compilers like MSVC. + + With the patched Makefiles, you can easily build standard Windows + .LIB and .EXE files using MSVC; just edit "config" and look for each + comment that begins "Windows users:". Then do "make". + (end of INSTALL) diff -urN lua-4.1-work4/Makefile lua-4.1-work4-Makefilepatches/Makefile --- lua-4.1-work4/Makefile Thu Feb 14 19:22:18 2002 +++ lua-4.1-work4-Makefilepatches/Makefile Mon Feb 18 11:15:20 2002 @@ -16,18 +16,18 @@ # simple test to see Lua working test: all - bin/lua test/hello.lua + bin/lua$(EXE) test/hello.lua # remove debug information from binaries strip: - $(STRIP) bin/lua bin/luac + $(STRIP) bin/lua$(EXE) bin/luac$(EXE) # official installation install: all strip mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_EXEC) bin/* $(INSTALL_BIN) $(INSTALL_DATA) include/*.h $(INSTALL_INC) - $(INSTALL_DATA) lib/*.a $(INSTALL_LIB) + $(INSTALL_DATA) lib/*$(A) $(INSTALL_LIB) $(INSTALL_DATA) doc/*.1 $(INSTALL_MAN) # shared libraries (for Linux) diff -urN lua-4.1-work4/config lua-4.1-work4-Makefilepatches/config --- lua-4.1-work4/config Tue Feb 12 21:01:46 2002 +++ lua-4.1-work4-Makefilepatches/config Mon Feb 18 13:03:56 2002 @@ -18,11 +18,33 @@ # You need popen in your C library. #POPEN= -DPOPEN +# ------------------------------------------------------------------ file extensions + +# Under Unix, these are the typical file extensions: +O= .o +EXE= +A= .a +SO= .so + +# Windows users: these are the typical file extensions: +#O= .obj +#EXE= .exe +#A= .lib +#SO= .dll + + # ------------------------------------------------------------------ C compiler # You need an ANSI C compiler. gcc is a popular one. -CC= gcc -WARN= -ansi -pedantic -Wall +#CC= gcc +#WARN= -ansi -pedantic -Wall + +# Windows users: MSVC is popular. +#CC= cl /nologo +#WARN= /W4 /Za +## GNU make needs to be told how to make .obj's (it only understands '.o' by default). +#%$(O): %.c +# $(CC) -c $(CFLAGS) $^ # On IRIX, cc is a good ANSI compiler. #CC= cc @@ -52,12 +74,14 @@ # If your C library is not POSIX compliant, comment the following line. # This is only used in the stand-alone Lua interpreter (src/lua/lua.c). +# Windows users: comment this out (or fix incompatibility in src/lua/lua.c). POSIX= -D_POSIX_SOURCE # The stand-alone Lua interpreter needs the math functions, which are usually # in libm.a (-lm). If your C library already includes the math functions, # or if you are using a modified interpreter that does not need them, # then comment the following line or add the appropriates libraries. +# Windows users: comment this out. EXTRA_LIBS= -lm # If you want to line editing and history in the stand-alone Lua interpreter, @@ -71,7 +95,12 @@ # This should work in all Unix systems. AR= ar rcu +# Windows users: this works with MSVC. +#AR= lib /nologo +#LIB_OUT_PREFIX= /OUT: + # If your system doesn't have (or need) ranlib, use RANLIB=true. +# Windows users: use "RANLIB= true" # On some systems, "ar s" does what ranlib would do. RANLIB= ranlib #RANLIB= ar s @@ -104,7 +133,8 @@ BIN= $(LUA)/bin INC= $(LUA)/include -LIB= $(LUA)/lib +# (using LIB as a macro screws up MSVC: it uses the environment var LIB to find its standard libraries.) +LUALIB= $(LUA)/lib INCS= -I$(INC) $(EXTRA_INCS) DEFS= $(NUMBER) $(EXTRA_DEFS) diff -urN lua-4.1-work4/src/Makefile lua-4.1-work4-Makefilepatches/src/Makefile --- lua-4.1-work4/src/Makefile Tue Feb 12 20:42:32 2002 +++ lua-4.1-work4-Makefilepatches/src/Makefile Mon Feb 18 11:42:28 2002 @@ -5,25 +5,25 @@ include $(LUA)/config OBJS= \ - lapi.o \ - lcode.o \ - ldebug.o \ - ldo.o \ - lfunc.o \ - lgc.o \ - llex.o \ - lmem.o \ - lobject.o \ - lopcodes.o \ - lparser.o \ - lstate.o \ - lstring.o \ - ltable.o \ - ltests.o \ - ltm.o \ - lundump.o \ - lvm.o \ - lzio.o + lapi$(O) \ + lcode$(O) \ + ldebug$(O) \ + ldo$(O) \ + lfunc$(O) \ + lgc$(O) \ + llex$(O) \ + lmem$(O) \ + lobject$(O) \ + lopcodes$(O) \ + lparser$(O) \ + lstate$(O) \ + lstring$(O) \ + ltable$(O) \ + ltests$(O) \ + ltm$(O) \ + lundump$(O) \ + lvm$(O) \ + lzio$(O) SRCS= \ lapi.c \ @@ -65,12 +65,12 @@ lvm.h \ lzio.h -T= $(LIB)/liblua.a +T= $(LUALIB)/liblua$(A) all: $T $T: $(OBJS) - $(AR) $@ $(OBJS) + $(AR) $(LIB_OUT_PREFIX)$@ $(OBJS) $(RANLIB) $@ clean: diff -urN lua-4.1-work4/src/lib/Makefile lua-4.1-work4-Makefilepatches/src/lib/Makefile --- lua-4.1-work4/src/lib/Makefile Tue Feb 12 20:41:44 2002 +++ lua-4.1-work4-Makefilepatches/src/lib/Makefile Mon Feb 18 11:41:16 2002 @@ -7,15 +7,15 @@ # actually only used in liolib.c EXTRA_DEFS= $(POPEN) -OBJS= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o lstrlib.o +OBJS= lauxlib$(O) lbaselib$(O) ldblib$(O) liolib$(O) lmathlib$(O) lstrlib$(O) SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c lstrlib.c -T= $(LIB)/liblualib.a +T= $(LUALIB)/liblualib$(A) all: $T $T: $(OBJS) - $(AR) $@ $(OBJS) + $(AR) $(LIB_OUT_PREFIX)$@ $(OBJS) $(RANLIB) $@ clean: diff -urN lua-4.1-work4/src/lua/Makefile lua-4.1-work4-Makefilepatches/src/lua/Makefile --- lua-4.1-work4/src/lua/Makefile Tue Feb 12 20:42:10 2002 +++ lua-4.1-work4-Makefilepatches/src/lua/Makefile Mon Feb 18 11:39:50 2002 @@ -6,20 +6,20 @@ EXTRA_DEFS= $(POSIX) $(READLINE) -OBJS= lua.o +OBJS= lua$(O) SRCS= lua.c -T= $(BIN)/lua +T= $(BIN)/lua$(EXE) all: $T -$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a - $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) +$T: $(OBJS) $(LUALIB)/liblua$(A) $(LUALIB)/liblualib$(A) + $(CC) -o $@ $(MYLDFLAGS) $(OBJS) $(LUALIB)/liblua$(A) $(LUALIB)/liblualib$(A) $(EXTRA_LIBS) -$(LIB)/liblua.a: +$(LUALIB)/liblua$(A): cd ..; $(MAKE) -$(LIB)/liblualib.a: +$(LUALIB)/liblualib$(A): cd ../lib; $(MAKE) clean: diff -urN lua-4.1-work4/src/luac/Makefile lua-4.1-work4-Makefilepatches/src/luac/Makefile --- lua-4.1-work4/src/luac/Makefile Tue Feb 12 20:41:00 2002 +++ lua-4.1-work4-Makefilepatches/src/luac/Makefile Mon Feb 18 11:42:26 2002 @@ -5,25 +5,25 @@ include $(LUA)/config INCS= -I$(INC) $(EXTRA_INCS) -I.. -OBJS= dump.o luac.o print.o lopcodes.o +OBJS= dump$(O) luac$(O) print$(O) lopcodes$(O) SRCS= dump.c luac.c print.c luac.h ldumplib.c -T= $(BIN)/luac +T= $(BIN)/luac$(EXE) all: $T -$T: $(OBJS) $(LIB)/liblua.a - $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua +$T: $(OBJS) $(LUALIB)/liblua$(A) + $(CC) -o $@ $(MYLDFLAGS) $(OBJS) $(LUALIB)/liblua$(A) # luac needs opcode names -lopcodes.o: ../lopcodes.c ../lopcodes.h +lopcodes$(O): ../lopcodes.c ../lopcodes.h $(CC) $(CFLAGS) -DLUA_OPNAMES -c -o $@ ../lopcodes.c -$(LIB)/liblua.a: +$(LUALIB)/liblua$(A): cd ..; $(MAKE) clean: - rm -f $(OBJS) ldumplib.o $T + rm -f $(OBJS) ldumplib$(O) $T co: co -q -f -M $(SRCS)

AltStyle によって変換されたページ (->オリジナル) /