mirror of
https://github.com/brunoos/luasec.git
synced 2024-11-08 06:28:26 +01:00
fceef56dce
Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>
62 lines
1.4 KiB
Makefile
62 lines
1.4 KiB
Makefile
CMOD=ssl.so
|
|
LMOD=ssl.lua
|
|
|
|
OBJS= \
|
|
x509.o \
|
|
context.o \
|
|
ssl.o
|
|
|
|
LIBS=-lssl -lcrypto -lluasocket
|
|
|
|
WARN=-Wall -pedantic
|
|
|
|
BSD_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
|
|
BSD_LDFLAGS=-O -fPIC -shared $(LIBDIR)
|
|
|
|
LNX_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
|
|
LNX_LDFLAGS=-O -fPIC -shared $(LIBDIR)
|
|
|
|
MAC_ENV=env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
|
|
MAC_CFLAGS=-O2 -fno-common $(WARN) $(INCDIR) $(DEFS)
|
|
MAC_LDFLAGS=-bundle -undefined dynamic_lookup $(LIBDIR)
|
|
|
|
INSTALL ?= install
|
|
CC ?= cc
|
|
LD ?= $(MYENV) cc
|
|
CFLAGS += $(MYCFLAGS)
|
|
LDFLAGS += $(MYLDFLAGS)
|
|
DESTDIR ?= /
|
|
|
|
.PHONY: all clean install none linux bsd macosx luasocket
|
|
|
|
all:
|
|
|
|
install: $(CMOD) $(LMOD)
|
|
$(INSTALL) -d $(DESTDIR)$(LUAPATH)/ssl $(DESTDIR)$(LUACPATH)
|
|
$(INSTALL) -D $(CMOD) $(DESTDIR)$(LUACPATH)
|
|
$(INSTALL) -m644 -D $(LMOD) $(DESTDIR)$(LUAPATH)
|
|
$(INSTALL) -m644 -D https.lua $(DESTDIR)$(LUAPATH)/ssl
|
|
|
|
linux:
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)" EXTRA="$(EXTRA)"
|
|
|
|
bsd:
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(BSD_CFLAGS)" MYLDFLAGS="$(BSD_LDFLAGS)" EXTRA="$(EXTRA)"
|
|
|
|
macosx:
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(MAC_CFLAGS)" MYLDFLAGS="$(MAC_LDFLAGS)" MYENV="$(MAC_ENV)" EXTRA="$(EXTRA)"
|
|
|
|
luasocket:
|
|
@cd luasocket && $(MAKE)
|
|
|
|
$(CMOD): $(EXTRA) $(OBJS)
|
|
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
|
|
clean:
|
|
cd luasocket && $(MAKE) clean
|
|
rm -f $(OBJS) $(CMOD)
|
|
|
|
x509.o: x509.c x509.h config.h
|
|
context.o: context.c context.h ec.h config.h
|
|
ssl.o: ssl.c ssl.h context.h x509.h config.h
|