diff options
author | Reuben Thomas <rrt@sc3d.org> | 2010-10-26 14:20:23 +0100 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2010-10-26 14:20:45 +0100 |
commit | cee4d819c42451bde38e2e23e67afc6fb876a83e (patch) | |
tree | 297e4cdc39e25ca2b929264bd8233970756e8cfc | |
parent | 46f735084490c3b80040ad6ddf1feba963dff1c3 (diff) | |
download | lrexlib-cee4d819c42451bde38e2e23e67afc6fb876a83e.tar.gz |
Improve portability of build system. (Shmuel)
-rw-r--r-- | doc/Makefile | 12 | ||||
-rw-r--r-- | src/gnu/Makefile | 4 | ||||
-rw-r--r-- | windows/mingw/Makefile | 34 | ||||
-rw-r--r-- | windows/mingw/_mingw.mak | 29 | ||||
-rw-r--r-- | windows/mingw/docs.mak | 13 | ||||
-rw-r--r-- | windows/mingw/rex_gnu.mak | 31 | ||||
-rw-r--r-- | windows/mingw/rex_onig.mak | 31 | ||||
-rw-r--r-- | windows/mingw/rex_pcre.mak | 31 | ||||
-rw-r--r-- | windows/mingw/rex_spencer.mak | 31 | ||||
-rw-r--r-- | windows/mingw/rex_tre.mak | 31 |
10 files changed, 102 insertions, 145 deletions
diff --git a/doc/Makefile b/doc/Makefile index 965e04e..81b44b5 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,8 +1,12 @@ # Documentation Makefile +APP = rst2html +CP = cp -a +RM = rm +IDX = ../README + .SUFFIXES: .txt .html -APP = rst2html CSS = --stylesheet-path=lrexlib.css --link-stylesheet HDR = --initial-header-level=2 DT = --date --time @@ -14,8 +18,8 @@ PAGES = index.html manual.html all: $(PAGES) -index.txt: ../README - cp -a $< $@ +index.txt: $(IDX) + $(CP) $< $@ clean: - rm $(PAGES) + $(RM) $(PAGES) index.txt diff --git a/src/gnu/Makefile b/src/gnu/Makefile index 8c3991d..bdb1de9 100644 --- a/src/gnu/Makefile +++ b/src/gnu/Makefile @@ -13,8 +13,8 @@ LIB = # try to uncomment and edit the settings below. # The default settings below work with a libgnu.a in the current directory, # copied from any libgnu.a built with the regex module. -#INC = -I. -DREX_GNU_INCLUDE='"regex.h"' -#LIB = -L. -lgnu +INC = -I. -DREX_GNU_INCLUDE='"regex.h"' +LIB = -L. -lgnu # Regex library name REGNAME = gnu diff --git a/windows/mingw/Makefile b/windows/mingw/Makefile index e7e859e..2689502 100644 --- a/windows/mingw/Makefile +++ b/windows/mingw/Makefile @@ -1,34 +1,26 @@ # Makefile for lrexlib +MKFILES = \ + rex_pcre.mak \ + rex_spencer.mak \ + rex_onig.mak \ + rex_gnu.mak \ + rex_tre.mak + +LOOP = @for %%d in ($(MKFILES)) do $(MAKE) -f %%d + all: build test build: - make -f rex_pcre.mak - make -f rex_spencer.mak - make -f rex_onig.mak - make -f rex_gnu.mak - make -f rex_tre.mak + $(LOOP) test: - make -f rex_pcre.mak test - make -f rex_spencer.mak test - make -f rex_onig.mak test - make -f rex_gnu.mak test - make -f rex_tre.mak test + $(LOOP) test install: - make -f rex_pcre.mak install - make -f rex_spencer.mak install - make -f rex_onig.mak install - make -f rex_gnu.mak install - make -f rex_tre.mak install + $(LOOP) install clean: - make -f rex_pcre.mak clean - make -f rex_spencer.mak clean - make -f rex_onig.mak clean - make -f rex_gnu.mak clean - make -f rex_tre.mak clean - + $(LOOP) clean .PHONY: all build test install clean diff --git a/windows/mingw/_mingw.mak b/windows/mingw/_mingw.mak index 8e2d532..b8d7c81 100644 --- a/windows/mingw/_mingw.mak +++ b/windows/mingw/_mingw.mak @@ -1,12 +1,26 @@ # tested with GNU Make -LIBS = --add-stdcall-alias $(MYLIBS) -s -INCS = $(MYINCS) -BIN = $(PROJECT).dll -DEFFILE = $(PROJECT).def -BININSTALL= $(INSTALLPATH)\$(BIN) -CC = gcc.exe -CFLAGS = $(INCS) -DREX_OPENLIB=luaopen_$(PROJECT) \ +# User Settings ------------------------------------------------------------ +# path of Lua include files +LUAINC = s:\progr\work\system\include + +# path of Lua DLL and regexp library DLL +DLLPATH = c:\exe + +# name of Lua DLL to link to (.dll should be omitted) +LUADLL = lua5.1 + +# path to install rex_onig.dll +INSTALLPATH = s:\exe\lib\lua\5.1 +# -------------------------------------------------------------------------- + +LIBS = $(MYLIBS) -s +INCS = $(MYINCS) +BIN = $(PROJECT).dll +DEFFILE = $(PROJECT).def +BININSTALL = $(INSTALLPATH)\$(BIN) +CC = gcc.exe +CFLAGS = $(INCS) -DREX_OPENLIB=luaopen_$(PROJECT) \ -DREX_LIBNAME=\"$(PROJECT)\" $(MYCFLAGS) .PHONY: all install test clean @@ -33,4 +47,3 @@ $(DEFFILE): $(BININSTALL): $(BIN) copy /Y $< $@ - diff --git a/windows/mingw/docs.mak b/windows/mingw/docs.mak new file mode 100644 index 0000000..ce72171 --- /dev/null +++ b/windows/mingw/docs.mak @@ -0,0 +1,13 @@ +# Documentation Makefile + +APP = rst2html.py +CP = "copy /y" +RM = del +IDX = ..\README + +ALLVAR = APP=$(APP) CP=$(CP) RM=$(RM) IDX=$(IDX) + +.PHONY: all clean + +all clean: + cd ..\..\doc && $(MAKE) $(ALLVAR) $@ diff --git a/windows/mingw/rex_gnu.mak b/windows/mingw/rex_gnu.mak index 157951c..0675658 100644 --- a/windows/mingw/rex_gnu.mak +++ b/windows/mingw/rex_gnu.mak @@ -1,34 +1,21 @@ # Project: rex_gnu # User Settings ------------------------------------------------------------ -# path of Lua include files -LUAINC = s:\progr\work\system\include - # path of GNU include files REGEXINC = s:\progr\work\system\include\gnuregex - -# path of Lua DLL and regex2.dll -DLLPATH = c:\exe - -# name of Lua DLL to link to (.dll should be omitted) -LUADLL = lua5.1 - -# path to install rex_gnu.dll -INSTALLPATH = s:\exe\lib\lua\5.1 # -------------------------------------------------------------------------- -PROJECT = rex_gnu -MYINCS = -I$(REGEXINC) -I$(LUAINC) -MYLIBS = -L$(DLLPATH) -lregex2 -l$(LUADLL) -OBJ = lgnu.o common.o -MYCFLAGS = -W -Wall -O2 -EXPORTED = 'luaopen_$(PROJECT)' -SRCPATH = ..\..\src;..\..\src\gnu -TESTPATH = ..\..\test -TESTNAME = gnu +PROJECT = rex_gnu +MYINCS = -I$(REGEXINC) -I$(LUAINC) +MYLIBS = -L$(DLLPATH) -lregex2 -l$(LUADLL) +OBJ = lgnu.o common.o +MYCFLAGS = -W -Wall -O2 +EXPORTED = 'luaopen_$(PROJECT)' +SRCPATH = ..\..\src;..\..\src\gnu +TESTPATH = ..\..\test +TESTNAME = gnu include _mingw.mak lgnu.o : common.h algo.h common.o : common.h - diff --git a/windows/mingw/rex_onig.mak b/windows/mingw/rex_onig.mak index 1e3e2a0..b69d3a9 100644 --- a/windows/mingw/rex_onig.mak +++ b/windows/mingw/rex_onig.mak @@ -1,35 +1,22 @@ # Project: rex_onig # User Settings ------------------------------------------------------------ -# path of Lua include files -LUAINC = s:\progr\work\system\include - # path of Oniguruma include files REGEXINC = s:\progr\work\system\include - -# path of Lua DLL and onig.dll -DLLPATH = c:\exe - -# name of Lua DLL to link to (.dll should be omitted) -LUADLL = lua5.1 - -# path to install rex_onig.dll -INSTALLPATH = s:\exe\lib\lua\5.1 # -------------------------------------------------------------------------- -PROJECT = rex_onig -MYINCS = -I$(REGEXINC) -I$(LUAINC) -MYLIBS = -L$(DLLPATH) -lonig -l$(LUADLL) -Wl,--enable-auto-import -OBJ = lonig.o lonig_f.o common.o -MYCFLAGS = -W -Wall -O2 -EXPORTED = 'luaopen_$(PROJECT)' -SRCPATH = ..\..\src;..\..\src\oniguruma -TESTPATH = ..\..\test -TESTNAME = onig +PROJECT = rex_onig +MYINCS = -I$(REGEXINC) -I$(LUAINC) +MYLIBS = -L$(DLLPATH) -lonig -l$(LUADLL) -Wl,--enable-auto-import +OBJ = lonig.o lonig_f.o common.o +MYCFLAGS = -W -Wall -O2 +EXPORTED = 'luaopen_$(PROJECT)' +SRCPATH = ..\..\src;..\..\src\oniguruma +TESTPATH = ..\..\test +TESTNAME = onig include _mingw.mak lonig.o : common.h algo.h lonig_f.o : common.h common.o : common.h - diff --git a/windows/mingw/rex_pcre.mak b/windows/mingw/rex_pcre.mak index 0c334d3..d134b05 100644 --- a/windows/mingw/rex_pcre.mak +++ b/windows/mingw/rex_pcre.mak @@ -1,35 +1,22 @@ # Project: rex_pcre # User Settings ------------------------------------------------------------ -# path of Lua include files -LUAINC = s:\progr\work\system\include - # path of PCRE include files REGEXINC = s:\progr\work\system\include - -# path of Lua DLL and pcre.dll -DLLPATH = c:\exe - -# name of Lua DLL to link to (.dll should be omitted) -LUADLL = lua5.1 - -# path to install rex_pcre.dll -INSTALLPATH = s:\exe\lib\lua\5.1 # -------------------------------------------------------------------------- -PROJECT = rex_pcre -MYINCS = -I$(REGEXINC) -I$(LUAINC) -MYLIBS = -L$(DLLPATH) -lpcre -l$(LUADLL) -OBJ = lpcre.o lpcre_f.o common.o -MYCFLAGS = -W -Wall -O2 -EXPORTED = 'luaopen_$(PROJECT)' -SRCPATH = ..\..\src;..\..\src\pcre -TESTPATH = ..\..\test -TESTNAME = pcre +PROJECT = rex_pcre +MYINCS = -I$(REGEXINC) -I$(LUAINC) +MYLIBS = -L$(DLLPATH) -lpcre -l$(LUADLL) +OBJ = lpcre.o lpcre_f.o common.o +MYCFLAGS = -W -Wall -O2 +EXPORTED = 'luaopen_$(PROJECT)' +SRCPATH = ..\..\src;..\..\src\pcre +TESTPATH = ..\..\test +TESTNAME = pcre include _mingw.mak lpcre.o : common.h algo.h lpcre_f.o : common.h common.o : common.h - diff --git a/windows/mingw/rex_spencer.mak b/windows/mingw/rex_spencer.mak index 5a9f4f2..23ae67c 100644 --- a/windows/mingw/rex_spencer.mak +++ b/windows/mingw/rex_spencer.mak @@ -1,34 +1,21 @@ # Project: rex_spencer # User Settings ------------------------------------------------------------ -# path of Lua include files -LUAINC = s:\progr\work\system\include - # path of Spencer's include files REGEXINC = s:\progr\work\system\include\rxspencer - -# path of Lua DLL and rxspencer.dll -DLLPATH = c:\exe - -# name of Lua DLL to link to (.dll should be omitted) -LUADLL = lua5.1 - -# path to install rex_spencer.dll -INSTALLPATH = s:\exe\lib\lua\5.1 # -------------------------------------------------------------------------- -PROJECT = rex_spencer -MYINCS = -I$(REGEXINC) -I$(LUAINC) -MYLIBS = -L$(DLLPATH) -lrxspencer -l$(LUADLL) -OBJ = lposix.o common.o -MYCFLAGS = -W -Wall -O2 -EXPORTED = 'luaopen_$(PROJECT)' -SRCPATH = ..\..\src;..\..\src\posix -TESTPATH = ..\..\test -TESTNAME = spencer +PROJECT = rex_spencer +MYINCS = -I$(REGEXINC) -I$(LUAINC) +MYLIBS = -L$(DLLPATH) -lrxspencer -l$(LUADLL) +OBJ = lposix.o common.o +MYCFLAGS = -W -Wall -O2 +EXPORTED = 'luaopen_$(PROJECT)' +SRCPATH = ..\..\src;..\..\src\posix +TESTPATH = ..\..\test +TESTNAME = spencer include _mingw.mak lposix.o : common.h algo.h common.o : common.h - diff --git a/windows/mingw/rex_tre.mak b/windows/mingw/rex_tre.mak index 71c1b33..70a1f36 100644 --- a/windows/mingw/rex_tre.mak +++ b/windows/mingw/rex_tre.mak @@ -1,34 +1,21 @@ # Project: rex_tre # User Settings ------------------------------------------------------------ -# path of Lua include files -LUAINC = s:\progr\work\system\include - # path of TRE include files REGEXINC = s:\progr\work\system\include - -# path of Lua DLL and tre.dll -DLLPATH = c:\exe - -# name of Lua DLL to link to (.dll should be omitted) -LUADLL = lua5.1 - -# path to install rex_tre.dll -INSTALLPATH = s:\exe\lib\lua\5.1 # -------------------------------------------------------------------------- -PROJECT = rex_tre -MYINCS = -I$(REGEXINC) -I$(LUAINC) -MYLIBS = -L$(DLLPATH) -ltre -l$(LUADLL) -OBJ = ltre.o common.o -MYCFLAGS = -W -Wall -O2 -EXPORTED = 'luaopen_$(PROJECT)' -SRCPATH = ..\..\src;..\..\src\tre -TESTPATH = ..\..\test -TESTNAME = tre +PROJECT = rex_tre +MYINCS = -I$(REGEXINC) -I$(LUAINC) +MYLIBS = -L$(DLLPATH) -ltre -l$(LUADLL) +OBJ = ltre.o common.o +MYCFLAGS = -W -Wall -O2 +EXPORTED = 'luaopen_$(PROJECT)' +SRCPATH = ..\..\src;..\..\src\tre +TESTPATH = ..\..\test +TESTNAME = tre include _mingw.mak ltre.o : common.h algo.h common.o : common.h - |