2012-04-26 22:33:01 +02:00
|
|
|
# luasocket src/makefile
|
|
|
|
#
|
|
|
|
# Definitions in this section can be overriden on the command line or in the
|
|
|
|
# environment.
|
|
|
|
#
|
|
|
|
# These are equivalent:
|
|
|
|
#
|
|
|
|
# export PLAT=linux DEBUG=DEBUG LUAV=5.2 prefix=/sw
|
|
|
|
# make
|
|
|
|
#
|
|
|
|
# and
|
|
|
|
#
|
|
|
|
# make PLAT=linux DEBUG=DEBUG LUAV=5.2 prefix=/sw
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
# PLAT: linux macosx win32 mingw
|
2012-04-26 22:33:01 +02:00
|
|
|
# platform to build for
|
|
|
|
PLAT?=linux
|
|
|
|
|
|
|
|
# LUAV: 5.1 5.2
|
|
|
|
# lua version to build against
|
2012-04-11 23:18:20 +02:00
|
|
|
LUAV?=5.1
|
2011-05-25 22:57:22 +02:00
|
|
|
|
2013-09-09 19:55:20 +02:00
|
|
|
# MYCFLAGS: to be set by user if needed
|
|
|
|
MYCFLAGS=
|
|
|
|
|
|
|
|
# MYLDFLAGS: to be set by user if needed
|
|
|
|
MYLDFLAGS=
|
|
|
|
|
2012-04-26 22:33:01 +02:00
|
|
|
# DEBUG: NODEBUG DEBUG
|
|
|
|
# debug mode causes luasocket to collect and returns timing information useful
|
|
|
|
# for testing and debugging luasocket itself
|
|
|
|
DEBUG?=NODEBUG
|
2011-05-25 22:57:22 +02:00
|
|
|
|
2012-04-26 22:33:01 +02:00
|
|
|
# where lua headers are found for macosx builds
|
2013-05-30 10:20:34 +02:00
|
|
|
# LUAINC_macosx:
|
2012-05-11 09:33:47 +02:00
|
|
|
# /opt/local/include
|
|
|
|
LUAINC_macosx_base?=/opt/local/include
|
2013-05-25 12:25:02 +02:00
|
|
|
LUAINC_macosx?=$(LUAINC_macosx_base)/lua/$(LUAV)
|
2012-05-11 09:33:47 +02:00
|
|
|
# FIXME default should this default to fink or to macports?
|
|
|
|
# What happens when more than one Lua version is installed?
|
2012-12-11 19:35:27 +01:00
|
|
|
LUAPREFIX_macosx?=/opt/local
|
2013-05-25 12:07:38 +02:00
|
|
|
CDIR_macosx?=lib/lua/$(LUAV)
|
|
|
|
LDIR_macosx?=share/lua/$(LUAV)
|
|
|
|
|
2013-05-30 10:20:34 +02:00
|
|
|
# LUAINC_linux:
|
|
|
|
# /usr/include/lua$(LUAV)
|
|
|
|
# /usr/local/include
|
2012-05-11 09:33:47 +02:00
|
|
|
# /usr/local/include/lua$(LUAV)
|
2012-04-26 22:33:01 +02:00
|
|
|
# where lua headers are found for linux builds
|
2012-05-11 09:33:47 +02:00
|
|
|
LUAINC_linux_base?=/usr/include
|
2013-05-25 12:25:02 +02:00
|
|
|
LUAINC_linux?=$(LUAINC_linux_base)/lua/$(LUAV)
|
2012-05-11 09:33:47 +02:00
|
|
|
LUAPREFIX_linux?=/usr/local
|
2013-05-25 12:07:38 +02:00
|
|
|
CDIR_linux?=lib/lua/$(LUAV)
|
|
|
|
LDIR_linux?=share/lua/$(LUAV)
|
|
|
|
|
2013-09-09 19:29:14 +02:00
|
|
|
# LUAINC_freebsd:
|
|
|
|
# /usr/local/include/lua$(LUAV)
|
2016-01-15 18:48:57 +01:00
|
|
|
# where lua headers are found for freebsd builds
|
2013-09-09 19:29:14 +02:00
|
|
|
LUAINC_freebsd_base?=/usr/local/include/
|
|
|
|
LUAINC_freebsd?=$(LUAINC_freebsd_base)/lua$(LUAV)
|
|
|
|
LUAPREFIX_freebsd?=/usr/local/
|
|
|
|
CDIR_freebsd?=lib/lua/$(LUAV)
|
|
|
|
LDIR_freebsd?=share/lua/$(LUAV)
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
# where lua headers are found for mingw builds
|
2013-09-09 19:55:20 +02:00
|
|
|
# LUAINC_mingw:
|
2013-05-25 12:07:38 +02:00
|
|
|
# /opt/local/include
|
|
|
|
LUAINC_mingw_base?=/usr/include
|
|
|
|
LUAINC_mingw?=$(LUAINC_mingw_base)/lua/$(LUAV)
|
|
|
|
LUALIB_mingw_base?=/usr/bin
|
|
|
|
LUALIB_mingw?=$(LUALIB_mingw_base)/lua/$(LUAV)/lua$(subst .,,$(LUAV)).dll
|
|
|
|
LUAPREFIX_mingw?=/usr
|
|
|
|
CDIR_mingw?=lua/$(LUAV)
|
|
|
|
LDIR_mingw?=lua/$(LUAV)/lua
|
|
|
|
|
2012-04-26 22:33:01 +02:00
|
|
|
|
|
|
|
# LUAINC_win32:
|
|
|
|
# LUALIB_win32:
|
|
|
|
# where lua headers and libraries are found for win32 builds
|
2012-05-11 09:33:47 +02:00
|
|
|
LUAPREFIX_win32?=
|
2015-10-05 04:28:29 +02:00
|
|
|
LUAINC_win32?=$(LUAPREFIX_win32)/include/lua/$(LUAV)
|
|
|
|
PLATFORM_win32?=Release
|
|
|
|
CDIR_win32?=bin/lua/$(LUAV)/$(PLATFORM_win32)
|
|
|
|
LDIR_win32?=bin/lua/$(LUAV)/$(PLATFORM_win32)/lua
|
|
|
|
LUALIB_win32?=$(LUAPREFIX_win32)/lib/lua/$(LUAV)/$(PLATFORM_win32)
|
|
|
|
LUALIBNAME_win32?=lua$(subst .,,$(LUAV)).lib
|
|
|
|
|
2012-04-26 22:33:01 +02:00
|
|
|
|
2016-01-15 18:48:57 +01:00
|
|
|
# LUAINC_solaris:
|
|
|
|
LUAINC_solaris_base?=/usr/include
|
|
|
|
LUAINC_solaris?=$(LUAINC_solaris_base)/lua/$(LUAV)
|
|
|
|
LUAPREFIX_solaris?=/usr/local
|
|
|
|
CDIR_solaris?=lib/lua/$(LUAV)
|
|
|
|
LDIR_solaris?=share/lua/$(LUAV)
|
|
|
|
|
2012-05-11 09:33:47 +02:00
|
|
|
# prefix: /usr/local /usr /opt/local /sw
|
|
|
|
# the top of the default install tree
|
|
|
|
prefix?=$(LUAPREFIX_$(PLAT))
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
CDIR?=$(CDIR_$(PLAT))
|
|
|
|
LDIR?=$(LDIR_$(PLAT))
|
|
|
|
|
2012-04-26 22:33:01 +02:00
|
|
|
# DESTDIR: (no default)
|
|
|
|
# used by package managers to install into a temporary destination
|
|
|
|
DESTDIR=
|
|
|
|
|
|
|
|
#------
|
|
|
|
# Definitions below can be overridden on the make command line, but
|
|
|
|
# shouldn't have to be.
|
2012-04-11 23:18:20 +02:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
|
2005-08-12 07:56:32 +02:00
|
|
|
#------
|
2009-05-27 11:31:38 +02:00
|
|
|
# Install directories
|
2005-08-12 07:56:32 +02:00
|
|
|
#
|
2012-04-11 23:18:20 +02:00
|
|
|
|
2012-05-15 18:44:38 +02:00
|
|
|
INSTALL_DIR=install -d
|
|
|
|
INSTALL_DATA=install -m644
|
|
|
|
INSTALL_EXEC=install
|
2012-04-11 23:18:20 +02:00
|
|
|
INSTALL_TOP=$(DESTDIR)$(prefix)
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
INSTALL_TOP_LDIR=$(INSTALL_TOP)/$(LDIR)
|
|
|
|
INSTALL_TOP_CDIR=$(INSTALL_TOP)/$(CDIR)
|
|
|
|
|
|
|
|
INSTALL_SOCKET_LDIR=$(INSTALL_TOP_LDIR)/socket
|
|
|
|
INSTALL_SOCKET_CDIR=$(INSTALL_TOP_CDIR)/socket
|
|
|
|
INSTALL_MIME_LDIR=$(INSTALL_TOP_LDIR)/mime
|
|
|
|
INSTALL_MIME_CDIR=$(INSTALL_TOP_CDIR)/mime
|
2011-07-05 00:31:14 +02:00
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
print:
|
|
|
|
@echo PLAT=$(PLAT)
|
|
|
|
@echo LUAV=$(LUAV)
|
|
|
|
@echo DEBUG=$(DEBUG)
|
|
|
|
@echo prefix=$(prefix)
|
|
|
|
@echo LUAINC_$(PLAT)=$(LUAINC_$(PLAT))
|
|
|
|
@echo LUALIB_$(PLAT)=$(LUALIB_$(PLAT))
|
|
|
|
@echo INSTALL_TOP_CDIR=$(INSTALL_TOP_CDIR)
|
|
|
|
@echo INSTALL_TOP_LDIR=$(INSTALL_TOP_LDIR)
|
2005-08-12 07:56:32 +02:00
|
|
|
|
|
|
|
#------
|
2011-05-25 22:57:22 +02:00
|
|
|
# Supported platforms
|
2005-08-12 07:56:32 +02:00
|
|
|
#
|
2016-01-15 18:48:57 +01:00
|
|
|
PLATS= macosx linux win32 mingw solaris
|
2005-08-12 07:56:32 +02:00
|
|
|
|
|
|
|
#------
|
2009-05-27 11:31:38 +02:00
|
|
|
# Compiler and linker settings
|
|
|
|
# for Mac OS X
|
2011-05-25 22:57:22 +02:00
|
|
|
SO_macosx=so
|
|
|
|
O_macosx=o
|
2009-05-27 11:31:38 +02:00
|
|
|
CC_macosx=gcc
|
2015-10-05 04:28:29 +02:00
|
|
|
DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN \
|
2009-05-27 11:31:38 +02:00
|
|
|
-DLUASOCKET_API='__attribute__((visibility("default")))' \
|
2013-06-11 11:20:27 +02:00
|
|
|
-DUNIX_API='__attribute__((visibility("default")))' \
|
2009-05-27 11:31:38 +02:00
|
|
|
-DMIME_API='__attribute__((visibility("default")))'
|
2015-02-18 23:51:37 +01:00
|
|
|
CFLAGS_macosx= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common \
|
2009-05-27 11:31:38 +02:00
|
|
|
-fvisibility=hidden
|
2013-06-12 15:45:15 +02:00
|
|
|
LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
|
2009-05-27 11:31:38 +02:00
|
|
|
LD_macosx= export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
|
2011-05-25 22:57:22 +02:00
|
|
|
SOCKET_macosx=usocket.o
|
2006-04-20 06:16:23 +02:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
#------
|
|
|
|
# Compiler and linker settings
|
|
|
|
# for Linux
|
2011-05-25 22:57:22 +02:00
|
|
|
SO_linux=so
|
|
|
|
O_linux=o
|
2009-05-27 11:31:38 +02:00
|
|
|
CC_linux=gcc
|
2015-10-05 04:28:29 +02:00
|
|
|
DEF_linux=-DLUASOCKET_$(DEBUG) \
|
2009-05-27 11:31:38 +02:00
|
|
|
-DLUASOCKET_API='__attribute__((visibility("default")))' \
|
2013-06-11 11:20:27 +02:00
|
|
|
-DUNIX_API='__attribute__((visibility("default")))' \
|
2009-05-27 11:31:38 +02:00
|
|
|
-DMIME_API='__attribute__((visibility("default")))'
|
2015-02-18 23:51:37 +01:00
|
|
|
CFLAGS_linux= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
|
2013-05-25 12:07:38 +02:00
|
|
|
-Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
|
2011-05-25 22:57:22 +02:00
|
|
|
LDFLAGS_linux=-O -shared -fpic -o
|
|
|
|
LD_linux=gcc
|
|
|
|
SOCKET_linux=usocket.o
|
|
|
|
|
2013-09-09 19:29:14 +02:00
|
|
|
#------
|
|
|
|
# Compiler and linker settings
|
|
|
|
# for FreeBSD
|
|
|
|
SO_freebsd=so
|
|
|
|
O_freebsd=o
|
|
|
|
CC_freebsd=gcc
|
2015-10-05 04:28:29 +02:00
|
|
|
DEF_freebsd=-DLUASOCKET_$(DEBUG) \
|
2013-09-09 19:29:14 +02:00
|
|
|
-DLUASOCKET_API='__attribute__((visibility("default")))' \
|
|
|
|
-DUNIX_API='__attribute__((visibility("default")))' \
|
|
|
|
-DMIME_API='__attribute__((visibility("default")))'
|
2015-02-18 23:51:37 +01:00
|
|
|
CFLAGS_freebsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
|
2013-09-09 19:29:14 +02:00
|
|
|
-Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
|
|
|
|
LDFLAGS_freebsd=-O -shared -fpic -o
|
|
|
|
LD_freebsd=gcc
|
|
|
|
SOCKET_freebsd=usocket.o
|
|
|
|
|
2016-01-15 18:48:57 +01:00
|
|
|
#------
|
|
|
|
# Compiler and linker settings
|
|
|
|
# for Solaris
|
|
|
|
SO_solaris=so
|
|
|
|
O_solaris=o
|
|
|
|
CC_solaris=gcc
|
|
|
|
DEF_solaris=-DLUASOCKET_$(DEBUG) \
|
|
|
|
-DLUASOCKET_API='__attribute__((visibility("default")))' \
|
|
|
|
-DUNIX_API='__attribute__((visibility("default")))' \
|
|
|
|
-DMIME_API='__attribute__((visibility("default")))'
|
|
|
|
CFLAGS_solaris=-I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
|
|
|
|
-Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
|
|
|
|
LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o
|
|
|
|
LD_solaris=gcc
|
|
|
|
SOCKET_solaris=usocket.o
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
#------
|
|
|
|
# Compiler and linker settings
|
|
|
|
# for MingW
|
|
|
|
SO_mingw=dll
|
|
|
|
O_mingw=o
|
|
|
|
CC_mingw=gcc
|
2015-10-05 04:28:29 +02:00
|
|
|
DEF_mingw= -DLUASOCKET_INET_PTON -DLUASOCKET_$(DEBUG) \
|
2013-05-27 14:30:06 +02:00
|
|
|
-DWINVER=0x0501 -DLUASOCKET_API='__declspec(dllexport)' \
|
2013-05-25 12:07:38 +02:00
|
|
|
-DMIME_API='__declspec(dllexport)'
|
2015-02-18 23:51:37 +01:00
|
|
|
CFLAGS_mingw= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common \
|
2013-05-25 12:07:38 +02:00
|
|
|
-fvisibility=hidden
|
2013-05-27 15:58:41 +02:00
|
|
|
LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
|
2013-05-25 12:07:38 +02:00
|
|
|
LD_mingw=gcc
|
|
|
|
SOCKET_mingw=wsocket.o
|
|
|
|
|
|
|
|
|
2011-05-25 22:57:22 +02:00
|
|
|
#------
|
|
|
|
# Compiler and linker settings
|
|
|
|
# for Win32
|
|
|
|
SO_win32=dll
|
|
|
|
O_win32=obj
|
|
|
|
CC_win32=cl
|
2013-05-27 14:30:06 +02:00
|
|
|
DEF_win32= //D "WIN32" //D "NDEBUG" //D "_WINDOWS" //D "_USRDLL" \
|
|
|
|
//D "LUASOCKET_API=__declspec(dllexport)" //D "_CRT_SECURE_NO_WARNINGS" \
|
2015-10-05 04:28:29 +02:00
|
|
|
//D "_WINDLL" //D "MIME_API=__declspec(dllexport)" \
|
2013-05-27 14:30:06 +02:00
|
|
|
//D "LUASOCKET_$(DEBUG)"
|
|
|
|
CFLAGS_win32=//I "$(LUAINC)" $(DEF) //O2 //Ot //MD //W3 //nologo
|
|
|
|
LDFLAGS_win32= //nologo //link //NOLOGO //DLL //INCREMENTAL:NO \
|
|
|
|
//MANIFEST //MANIFESTFILE:"intermediate.manifest" \
|
|
|
|
//MANIFESTUAC:"level='asInvoker' uiAccess='false'" \
|
|
|
|
//SUBSYSTEM:WINDOWS //OPT:REF //OPT:ICF //DYNAMICBASE:NO \
|
2013-05-27 15:58:41 +02:00
|
|
|
//MACHINE:X86 /LIBPATH:"$(shell cmd //c echo $(LUALIB))" \
|
2015-10-05 04:28:29 +02:00
|
|
|
$(LUALIBNAME_win32) ws2_32.lib //OUT:
|
2011-05-25 22:57:22 +02:00
|
|
|
LD_win32=cl
|
|
|
|
SOCKET_win32=wsocket.obj
|
|
|
|
|
|
|
|
.SUFFIXES: .obj
|
|
|
|
|
|
|
|
.c.obj:
|
2015-10-05 04:28:29 +02:00
|
|
|
$(CC) $(CFLAGS) //Fo"$@" //c $<
|
2011-05-25 22:57:22 +02:00
|
|
|
|
|
|
|
#------
|
|
|
|
# Output file names
|
|
|
|
#
|
|
|
|
SO=$(SO_$(PLAT))
|
|
|
|
O=$(O_$(PLAT))
|
2013-06-11 13:10:03 +02:00
|
|
|
SOCKET_V=3.0-rc1
|
2011-05-25 22:57:22 +02:00
|
|
|
MIME_V=1.0.3
|
2015-10-05 04:28:29 +02:00
|
|
|
SOCKET_SO=socket-$(SOCKET_V).$(SO)
|
|
|
|
MIME_SO=mime-$(MIME_V).$(SO)
|
2011-05-25 22:57:22 +02:00
|
|
|
UNIX_SO=unix.$(SO)
|
2012-04-11 23:18:20 +02:00
|
|
|
SERIAL_SO=serial.$(SO)
|
2011-05-25 22:57:22 +02:00
|
|
|
SOCKET=$(SOCKET_$(PLAT))
|
2007-03-12 05:08:40 +01:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
#------
|
|
|
|
# Settings selected for platform
|
|
|
|
#
|
|
|
|
CC=$(CC_$(PLAT))
|
|
|
|
DEF=$(DEF_$(PLAT))
|
2013-09-09 19:55:20 +02:00
|
|
|
CFLAGS=$(MYCFLAGS) $(CFLAGS_$(PLAT))
|
|
|
|
LDFLAGS=$(MYLDFLAGS) $(LDFLAGS_$(PLAT))
|
2009-05-27 11:31:38 +02:00
|
|
|
LD=$(LD_$(PLAT))
|
2011-05-25 22:57:22 +02:00
|
|
|
LUAINC= $(LUAINC_$(PLAT))
|
|
|
|
LUALIB= $(LUALIB_$(PLAT))
|
2009-05-27 11:31:38 +02:00
|
|
|
|
|
|
|
#------
|
|
|
|
# Modules belonging to socket-core
|
|
|
|
#
|
|
|
|
SOCKET_OBJS= \
|
2011-05-25 22:57:22 +02:00
|
|
|
luasocket.$(O) \
|
|
|
|
timeout.$(O) \
|
|
|
|
buffer.$(O) \
|
|
|
|
io.$(O) \
|
2012-04-11 23:18:20 +02:00
|
|
|
auxiliar.$(O) \
|
2015-08-21 20:39:34 +02:00
|
|
|
compat.$(O) \
|
2011-05-25 22:57:22 +02:00
|
|
|
options.$(O) \
|
|
|
|
inet.$(O) \
|
|
|
|
$(SOCKET) \
|
|
|
|
except.$(O) \
|
|
|
|
select.$(O) \
|
|
|
|
tcp.$(O) \
|
2012-04-16 14:41:48 +02:00
|
|
|
udp.$(O)
|
2005-08-12 07:56:32 +02:00
|
|
|
|
|
|
|
#------
|
|
|
|
# Modules belonging mime-core
|
|
|
|
#
|
2009-05-27 11:31:38 +02:00
|
|
|
MIME_OBJS= \
|
2015-08-21 20:39:34 +02:00
|
|
|
mime.$(O) \
|
|
|
|
compat.$(O)
|
2005-09-29 08:11:42 +02:00
|
|
|
|
2005-08-12 07:56:32 +02:00
|
|
|
#------
|
|
|
|
# Modules belonging unix (local domain sockets)
|
|
|
|
#
|
2011-05-25 22:57:22 +02:00
|
|
|
UNIX_OBJS=\
|
|
|
|
buffer.$(O) \
|
|
|
|
auxiliar.$(O) \
|
|
|
|
options.$(O) \
|
|
|
|
timeout.$(O) \
|
|
|
|
io.$(O) \
|
|
|
|
usocket.$(O) \
|
2012-04-16 14:41:48 +02:00
|
|
|
unix.$(O)
|
2005-08-12 07:56:32 +02:00
|
|
|
|
2012-02-24 02:12:37 +01:00
|
|
|
#------
|
|
|
|
# Modules belonging to serial (device streams)
|
|
|
|
#
|
2013-09-09 19:55:20 +02:00
|
|
|
SERIAL_OBJS=\
|
2012-04-11 23:18:20 +02:00
|
|
|
buffer.$(O) \
|
|
|
|
auxiliar.$(O) \
|
|
|
|
options.$(O) \
|
|
|
|
timeout.$(O) \
|
|
|
|
io.$(O) \
|
|
|
|
usocket.$(O) \
|
2012-04-16 14:41:48 +02:00
|
|
|
serial.$(O)
|
2012-04-11 23:18:20 +02:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
#------
|
|
|
|
# Files to install
|
|
|
|
#
|
2013-05-25 12:07:38 +02:00
|
|
|
TO_SOCKET_LDIR= \
|
2009-05-27 11:31:38 +02:00
|
|
|
http.lua \
|
|
|
|
url.lua \
|
|
|
|
tp.lua \
|
|
|
|
ftp.lua \
|
|
|
|
headers.lua \
|
|
|
|
smtp.lua
|
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
TO_TOP_LDIR= \
|
2009-05-27 11:31:38 +02:00
|
|
|
ltn12.lua \
|
|
|
|
socket.lua \
|
|
|
|
mime.lua
|
|
|
|
|
2011-05-25 22:57:22 +02:00
|
|
|
#------
|
|
|
|
# Targets
|
|
|
|
#
|
2009-05-27 11:31:38 +02:00
|
|
|
default: $(PLAT)
|
|
|
|
|
2013-09-09 19:29:14 +02:00
|
|
|
|
|
|
|
freebsd:
|
|
|
|
$(MAKE) all-unix PLAT=freebsd
|
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
macosx:
|
2012-04-11 23:18:20 +02:00
|
|
|
$(MAKE) all-unix PLAT=macosx
|
2009-05-27 11:31:38 +02:00
|
|
|
|
2011-05-25 22:57:22 +02:00
|
|
|
win32:
|
|
|
|
$(MAKE) all PLAT=win32
|
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
linux:
|
2012-04-11 23:18:20 +02:00
|
|
|
$(MAKE) all-unix PLAT=linux
|
2009-05-27 11:31:38 +02:00
|
|
|
|
2013-05-25 12:07:38 +02:00
|
|
|
mingw:
|
|
|
|
$(MAKE) all PLAT=mingw
|
2016-01-15 18:48:57 +01:00
|
|
|
|
|
|
|
solaris:
|
|
|
|
$(MAKE) all-unix PLAT=solaris
|
2013-05-25 12:07:38 +02:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
none:
|
2011-05-25 22:57:22 +02:00
|
|
|
@echo "Please run"
|
|
|
|
@echo " make PLATFORM"
|
|
|
|
@echo "where PLATFORM is one of these:"
|
2009-05-27 11:31:38 +02:00
|
|
|
@echo " $(PLATS)"
|
|
|
|
|
|
|
|
all: $(SOCKET_SO) $(MIME_SO)
|
2005-08-12 07:56:32 +02:00
|
|
|
|
|
|
|
$(SOCKET_SO): $(SOCKET_OBJS)
|
2013-05-30 10:20:34 +02:00
|
|
|
$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
|
2005-08-12 07:56:32 +02:00
|
|
|
|
|
|
|
$(MIME_SO): $(MIME_OBJS)
|
2013-05-30 10:20:34 +02:00
|
|
|
$(LD) $(MIME_OBJS) $(LDFLAGS)$@
|
2005-08-12 07:56:32 +02:00
|
|
|
|
2012-02-24 02:12:37 +01:00
|
|
|
all-unix: all $(UNIX_SO) $(SERIAL_SO)
|
2011-09-27 21:54:51 +02:00
|
|
|
|
2005-08-12 07:56:32 +02:00
|
|
|
$(UNIX_SO): $(UNIX_OBJS)
|
2013-05-30 10:20:34 +02:00
|
|
|
$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
|
2005-08-12 07:56:32 +02:00
|
|
|
|
2012-02-24 02:12:37 +01:00
|
|
|
$(SERIAL_SO): $(SERIAL_OBJS)
|
2012-04-11 23:18:20 +02:00
|
|
|
$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
|
2012-02-24 02:12:37 +01:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
install:
|
2013-05-25 12:07:38 +02:00
|
|
|
$(INSTALL_DIR) $(INSTALL_TOP_LDIR)
|
|
|
|
$(INSTALL_DATA) $(TO_TOP_LDIR) $(INSTALL_TOP_LDIR)
|
|
|
|
$(INSTALL_DIR) $(INSTALL_SOCKET_LDIR)
|
|
|
|
$(INSTALL_DATA) $(TO_SOCKET_LDIR) $(INSTALL_SOCKET_LDIR)
|
|
|
|
$(INSTALL_DIR) $(INSTALL_SOCKET_CDIR)
|
|
|
|
$(INSTALL_EXEC) $(SOCKET_SO) $(INSTALL_SOCKET_CDIR)/core.$(SO)
|
|
|
|
$(INSTALL_DIR) $(INSTALL_MIME_CDIR)
|
|
|
|
$(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_CDIR)/core.$(SO)
|
2009-05-27 11:31:38 +02:00
|
|
|
|
2012-04-11 23:18:20 +02:00
|
|
|
install-unix: install
|
2013-05-25 12:07:38 +02:00
|
|
|
$(INSTALL_EXEC) $(UNIX_SO) $(INSTALL_SOCKET_CDIR)/$(UNIX_SO)
|
|
|
|
$(INSTALL_EXEC) $(SERIAL_SO) $(INSTALL_SOCKET_CDIR)/$(SERIAL_SO)
|
2012-04-11 23:18:20 +02:00
|
|
|
|
2009-05-27 11:31:38 +02:00
|
|
|
local:
|
2013-05-25 12:07:38 +02:00
|
|
|
$(MAKE) install INSTALL_TOP_CDIR=.. INSTALL_TOP_LDIR=..
|
2009-05-27 11:31:38 +02:00
|
|
|
|
|
|
|
clean:
|
2012-08-01 07:13:27 +02:00
|
|
|
rm -f $(SOCKET_SO) $(SOCKET_OBJS) $(SERIAL_OBJS)
|
2012-04-11 23:18:20 +02:00
|
|
|
rm -f $(MIME_SO) $(UNIX_SO) $(SERIAL_SO) $(MIME_OBJS) $(UNIX_OBJS)
|
2009-05-27 11:31:38 +02:00
|
|
|
|
|
|
|
.PHONY: all $(PLATS) default clean echo none
|
|
|
|
|
2005-08-12 07:56:32 +02:00
|
|
|
#------
|
|
|
|
# List of dependencies
|
|
|
|
#
|
2015-08-21 20:39:34 +02:00
|
|
|
compat.$(O): compat.c compat.h
|
2011-05-25 22:57:22 +02:00
|
|
|
auxiliar.$(O): auxiliar.c auxiliar.h
|
|
|
|
buffer.$(O): buffer.c buffer.h io.h timeout.h
|
|
|
|
except.$(O): except.c except.h
|
|
|
|
inet.$(O): inet.c inet.h socket.h io.h timeout.h usocket.h
|
|
|
|
io.$(O): io.c io.h timeout.h
|
|
|
|
luasocket.$(O): luasocket.c luasocket.h auxiliar.h except.h \
|
2009-05-27 11:31:38 +02:00
|
|
|
timeout.h buffer.h io.h inet.h socket.h usocket.h tcp.h \
|
|
|
|
udp.h select.h
|
2011-05-25 22:57:22 +02:00
|
|
|
mime.$(O): mime.c mime.h
|
|
|
|
options.$(O): options.c auxiliar.h options.h socket.h io.h \
|
2009-05-27 11:31:38 +02:00
|
|
|
timeout.h usocket.h inet.h
|
2011-05-25 22:57:22 +02:00
|
|
|
select.$(O): select.c socket.h io.h timeout.h usocket.h select.h
|
2012-04-11 23:18:20 +02:00
|
|
|
serial.$(O): serial.c auxiliar.h socket.h io.h timeout.h usocket.h \
|
|
|
|
options.h unix.h buffer.h
|
2011-05-25 22:57:22 +02:00
|
|
|
tcp.$(O): tcp.c auxiliar.h socket.h io.h timeout.h usocket.h \
|
2009-05-27 11:31:38 +02:00
|
|
|
inet.h options.h tcp.h buffer.h
|
2011-05-25 22:57:22 +02:00
|
|
|
timeout.$(O): timeout.c auxiliar.h timeout.h
|
|
|
|
udp.$(O): udp.c auxiliar.h socket.h io.h timeout.h usocket.h \
|
2009-05-27 11:31:38 +02:00
|
|
|
inet.h options.h udp.h
|
2011-05-25 22:57:22 +02:00
|
|
|
unix.$(O): unix.c auxiliar.h socket.h io.h timeout.h usocket.h \
|
2009-05-27 11:31:38 +02:00
|
|
|
options.h unix.h buffer.h
|
2011-05-25 22:57:22 +02:00
|
|
|
usocket.$(O): usocket.c socket.h io.h timeout.h usocket.h
|
|
|
|
wsocket.$(O): wsocket.c socket.h io.h timeout.h usocket.h
|