diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2012-04-11 14:18:20 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2012-04-11 14:18:20 -0700 |
commit | 4b671f4551e98ac9e1d9a7407d3dffdd7eb1d3dc (patch) | |
tree | ba92aa753ae1b145760cb1c5e69c886d3bf11328 /src/makefile | |
parent | f399ab25fcecad2ff96a5977e8eaf069bb45473c (diff) | |
parent | 195b2a74bb3f368b1f31f9c8bbc1ce0f54de2035 (diff) | |
download | luasocket-4b671f4551e98ac9e1d9a7407d3dffdd7eb1d3dc.tar.gz luasocket-4b671f4551e98ac9e1d9a7407d3dffdd7eb1d3dc.tar.bz2 luasocket-4b671f4551e98ac9e1d9a7407d3dffdd7eb1d3dc.zip |
Merge branch 'git-sam' into diego-sam-mwild-integration
Conflicts in options.c were just due to independent small functions
being close to each other.
unix.c in mwild was broken, it wasn't using LUASOCKET_API.
serial.c needed luaL_reg renamed, and to use LUASOCKET_API.
makefile didn't respect standard DESTDIR and prefix makefile
variables, and didn't allow LUAV variable to select lua version to build
against.
I've tested the top-level install-both target builds and installs
against both lua5.1 and lua5.2, but not done further testing.
Conflicts:
README
config
gem/ltn012.tex
makefile
src/makefile
src/options.c
src/options.h
src/tcp.c
src/usocket.c
Diffstat (limited to 'src/makefile')
-rw-r--r-- | src/makefile | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/src/makefile b/src/makefile index b7c22da..a38ff98 100644 --- a/src/makefile +++ b/src/makefile | |||
@@ -1,30 +1,35 @@ | |||
1 | PLAT?=macosx | 1 | PLAT?=macosx |
2 | LUAV?=5.1 | ||
3 | prefix=/usr/local | ||
4 | #prefix=/opt/local | ||
5 | #prefix=. | ||
2 | 6 | ||
3 | INSTALL_DATA=cp | 7 | LUAINC_macosx=/usr/local/include |
4 | INSTALL_EXEC=cp | ||
5 | #INSTALL_TOP=/opt/local | ||
6 | INSTALL_TOP=./ | ||
7 | |||
8 | #LUAINC_macosx=/opt/local/include | 8 | #LUAINC_macosx=/opt/local/include |
9 | LUAINC_macosx=../../../../projects/lua_env/luaenv/lua_versions/lua-5.2.0-beta/src | 9 | #LUAINC_macosx=../../../../projects/lua_env/luaenv/lua_versions/lua-5.2.0-beta/src |
10 | #LUAINC_macosx=../../../../projects/lua_env/luaenv/lua_versions/lua-5.1.4/src | 10 | #LUAINC_macosx=../../../../projects/lua_env/luaenv/lua_versions/lua-5.1.4/src |
11 | 11 | ||
12 | LUAINC_linux=/usr/include/lua5.1 | 12 | #LUAINC_linux=/usr/local/include/lua$(LUAV) |
13 | LUAINC_linux=/usr/include/lua$(LUAV) | ||
14 | #LUAINC_linux=/usr/local/include | ||
15 | |||
13 | LUAINC_win32="../../lua-5.1.3/src" | 16 | LUAINC_win32="../../lua-5.1.3/src" |
14 | LUALIB_win32="../../lua-5.1.3" | 17 | LUALIB_win32="../../lua-5.1.3" |
15 | 18 | ||
16 | #------ | 19 | #------ |
17 | # Install directories | 20 | # Install directories |
18 | # | 21 | # |
19 | #INSTALL_TOP_SHARE=$(INSTALL_TOP)/share/lua/5.1 | 22 | |
20 | #INSTALL_TOP_LIB=$(INSTALL_TOP)/lib/lua/5.1 | 23 | INSTALL_DATA=cp |
21 | INSTALL_TOP_SHARE=$(INSTALL_TOP)/share/lua/5.2 | 24 | INSTALL_EXEC=cp |
22 | INSTALL_TOP_LIB=$(INSTALL_TOP)/lib/lua/5.2 | 25 | INSTALL_TOP=$(DESTDIR)$(prefix) |
26 | |||
27 | INSTALL_TOP_SHARE=$(INSTALL_TOP)/share/lua/$(LUAV) | ||
28 | INSTALL_TOP_LIB=$(INSTALL_TOP)/lib/lua/$(LUAV) | ||
23 | 29 | ||
24 | INSTALL_SOCKET_SHARE=$(INSTALL_TOP_SHARE)/socket | 30 | INSTALL_SOCKET_SHARE=$(INSTALL_TOP_SHARE)/socket |
25 | INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket | 31 | INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket |
26 | #INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime | 32 | INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime |
27 | INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/foo/mime | ||
28 | INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime | 33 | INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime |
29 | 34 | ||
30 | #------ | 35 | #------ |
@@ -78,7 +83,7 @@ LDFLAGS_win32= /nologo /link /NOLOGO /DLL /INCREMENTAL:NO \ | |||
78 | /MANIFESTFILE:"intermediate.manifest" \ | 83 | /MANIFESTFILE:"intermediate.manifest" \ |
79 | /MANIFESTUAC:"level='asInvoker' uiAccess='false'" \ | 84 | /MANIFESTUAC:"level='asInvoker' uiAccess='false'" \ |
80 | /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE:NO \ | 85 | /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE:NO \ |
81 | /MACHINE:X86 ws2_32.lib lua5.1.lib /OUT: | 86 | /MACHINE:X86 ws2_32.lib lua$(LUAV).lib /OUT: |
82 | LD_win32=cl | 87 | LD_win32=cl |
83 | SOCKET_win32=wsocket.obj | 88 | SOCKET_win32=wsocket.obj |
84 | 89 | ||
@@ -97,6 +102,7 @@ MIME_V=1.0.3 | |||
97 | SOCKET_SO=socket.$(SO).$(SOCKET_V) | 102 | SOCKET_SO=socket.$(SO).$(SOCKET_V) |
98 | MIME_SO=mime.$(SO).$(MIME_V) | 103 | MIME_SO=mime.$(SO).$(MIME_V) |
99 | UNIX_SO=unix.$(SO) | 104 | UNIX_SO=unix.$(SO) |
105 | SERIAL_SO=serial.$(SO) | ||
100 | SOCKET=$(SOCKET_$(PLAT)) | 106 | SOCKET=$(SOCKET_$(PLAT)) |
101 | 107 | ||
102 | #------ | 108 | #------ |
@@ -118,7 +124,7 @@ SOCKET_OBJS= \ | |||
118 | timeout.$(O) \ | 124 | timeout.$(O) \ |
119 | buffer.$(O) \ | 125 | buffer.$(O) \ |
120 | io.$(O) \ | 126 | io.$(O) \ |
121 | auxiliar.$(O) \ | 127 | auxiliar.$(O) \ |
122 | options.$(O) \ | 128 | options.$(O) \ |
123 | inet.$(O) \ | 129 | inet.$(O) \ |
124 | $(SOCKET) \ | 130 | $(SOCKET) \ |
@@ -148,6 +154,19 @@ UNIX_OBJS=\ | |||
148 | lua_typeerror.$(O) | 154 | lua_typeerror.$(O) |
149 | 155 | ||
150 | #------ | 156 | #------ |
157 | # Modules belonging to serial (device streams) | ||
158 | # | ||
159 | SERIAL_OBJS:=\ | ||
160 | buffer.$(O) \ | ||
161 | auxiliar.$(O) \ | ||
162 | options.$(O) \ | ||
163 | timeout.$(O) \ | ||
164 | io.$(O) \ | ||
165 | usocket.$(O) \ | ||
166 | serial.$(O) \ | ||
167 | lua_typeerror.$(O) | ||
168 | |||
169 | #------ | ||
151 | # Files to install | 170 | # Files to install |
152 | # | 171 | # |
153 | TO_SOCKET_SHARE= \ | 172 | TO_SOCKET_SHARE= \ |
@@ -169,13 +188,13 @@ TO_TOP_SHARE= \ | |||
169 | default: $(PLAT) | 188 | default: $(PLAT) |
170 | 189 | ||
171 | macosx: | 190 | macosx: |
172 | $(MAKE) all PLAT=macosx | 191 | $(MAKE) all-unix PLAT=macosx |
173 | 192 | ||
174 | win32: | 193 | win32: |
175 | $(MAKE) all PLAT=win32 | 194 | $(MAKE) all PLAT=win32 |
176 | 195 | ||
177 | linux: | 196 | linux: |
178 | $(MAKE) all PLAT=linux | 197 | $(MAKE) all-unix PLAT=linux |
179 | 198 | ||
180 | none: | 199 | none: |
181 | @echo "Please run" | 200 | @echo "Please run" |
@@ -191,9 +210,14 @@ $(SOCKET_SO): $(SOCKET_OBJS) | |||
191 | $(MIME_SO): $(MIME_OBJS) | 210 | $(MIME_SO): $(MIME_OBJS) |
192 | $(LD) $(MIME_OBJS) $(LDFLAGS)$@ | 211 | $(LD) $(MIME_OBJS) $(LDFLAGS)$@ |
193 | 212 | ||
213 | all-unix: all $(UNIX_SO) $(SERIAL_SO) | ||
214 | |||
194 | $(UNIX_SO): $(UNIX_OBJS) | 215 | $(UNIX_SO): $(UNIX_OBJS) |
195 | $(LD) $(UNIX_OBJS) $(LDFLAGS)$@ | 216 | $(LD) $(UNIX_OBJS) $(LDFLAGS)$@ |
196 | 217 | ||
218 | $(SERIAL_SO): $(SERIAL_OBJS) | ||
219 | $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ | ||
220 | |||
197 | install: | 221 | install: |
198 | mkdir -p $(INSTALL_TOP_SHARE) | 222 | mkdir -p $(INSTALL_TOP_SHARE) |
199 | $(INSTALL_DATA) $(TO_TOP_SHARE) $(INSTALL_TOP_SHARE) | 223 | $(INSTALL_DATA) $(TO_TOP_SHARE) $(INSTALL_TOP_SHARE) |
@@ -204,12 +228,16 @@ install: | |||
204 | mkdir -p $(INSTALL_MIME_LIB) | 228 | mkdir -p $(INSTALL_MIME_LIB) |
205 | $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(SO) | 229 | $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(SO) |
206 | 230 | ||
231 | install-unix: install | ||
232 | $(INSTALL_EXEC) $(UNIX_SO) $(INSTALL_SOCKET_LIB)/$(UNIX_SO) | ||
233 | $(INSTALL_EXEC) $(SERIAL_SO) $(INSTALL_SOCKET_LIB)/$(SERIAL_SO) | ||
234 | |||
207 | local: | 235 | local: |
208 | $(MAKE) install INSTALL_TOP_LIB=.. INSTALL_TOP_SHARE=.. | 236 | $(MAKE) install INSTALL_TOP_LIB=.. INSTALL_TOP_SHARE=.. |
209 | 237 | ||
210 | clean: | 238 | clean: |
211 | rm -f $(SOCKET_SO) $(SOCKET_OBJS) | 239 | rm -f $(SOCKET_SO) $(SOCKET_OBJS) |
212 | rm -f $(MIME_SO) $(UNIX_SO) $(MIME_OBJS) $(UNIX_OBJS) | 240 | rm -f $(MIME_SO) $(UNIX_SO) $(SERIAL_SO) $(MIME_OBJS) $(UNIX_OBJS) |
213 | 241 | ||
214 | .PHONY: all $(PLATS) default clean echo none | 242 | .PHONY: all $(PLATS) default clean echo none |
215 | 243 | ||
@@ -228,6 +256,8 @@ mime.$(O): mime.c mime.h | |||
228 | options.$(O): options.c auxiliar.h options.h socket.h io.h \ | 256 | options.$(O): options.c auxiliar.h options.h socket.h io.h \ |
229 | timeout.h usocket.h inet.h | 257 | timeout.h usocket.h inet.h |
230 | select.$(O): select.c socket.h io.h timeout.h usocket.h select.h | 258 | select.$(O): select.c socket.h io.h timeout.h usocket.h select.h |
259 | serial.$(O): serial.c auxiliar.h socket.h io.h timeout.h usocket.h \ | ||
260 | options.h unix.h buffer.h | ||
231 | tcp.$(O): tcp.c auxiliar.h socket.h io.h timeout.h usocket.h \ | 261 | tcp.$(O): tcp.c auxiliar.h socket.h io.h timeout.h usocket.h \ |
232 | inet.h options.h tcp.h buffer.h | 262 | inet.h options.h tcp.h buffer.h |
233 | timeout.$(O): timeout.c auxiliar.h timeout.h | 263 | timeout.$(O): timeout.c auxiliar.h timeout.h |