mirror of
https://github.com/brunoos/luasec.git
synced 2024-11-08 14:38:25 +01:00
62 lines
1.2 KiB
Makefile
62 lines
1.2 KiB
Makefile
|
CMOD=ssl.so
|
||
|
LMOD=ssl.lua
|
||
|
|
||
|
OBJS= \
|
||
|
timeout.o \
|
||
|
buffer.o \
|
||
|
io.o \
|
||
|
usocket.o \
|
||
|
context.o \
|
||
|
ssl.o
|
||
|
|
||
|
LIBS=-lssl -lcrypto
|
||
|
|
||
|
WARN=-Wall -pedantic
|
||
|
|
||
|
BSD_CFLAGS=-O2 -fpic $(WARN) $(INCDIR) $(DEFS)
|
||
|
BSD_LDFLAGS=-O -shared -fpic $(LIBDIR)
|
||
|
|
||
|
LNX_CFLAGS=-O2 -fpic $(WARN) $(INCDIR) $(DEFS)
|
||
|
LNX_LDFLAGS=-O -shared -fpic $(LIBDIR)
|
||
|
|
||
|
MAC_ENV=env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
|
||
|
MAC_CFLAGS=-O2 -fno-common $(WARN) $(INCDIR) $(DEFS)
|
||
|
MAC_LDFLAGS=-bundle -undefined dynamic_lookup $(LIBDIR)
|
||
|
|
||
|
CP=cp
|
||
|
CC=gcc
|
||
|
LD=$(MYENV) gcc
|
||
|
CFLAGS=$(MYCFLAGS)
|
||
|
LDFLAGS=$(MYLDFLAGS)
|
||
|
|
||
|
.PHONY: all clean install none linux bsd macosx
|
||
|
|
||
|
all:
|
||
|
|
||
|
install: $(CMOD) $(LMOD)
|
||
|
$(CP) $(CMOD) $(CPATH)
|
||
|
$(CP) $(LMOD) $(LUAPATH)
|
||
|
|
||
|
linux:
|
||
|
@make $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)"
|
||
|
|
||
|
bsd:
|
||
|
@make $(CMOD) MYCFLAGS="$(BSD_CFLAGS)" MYLDFLAGS="$(BSD_LDFLAGS)"
|
||
|
|
||
|
macosx:
|
||
|
@make $(CMOD) MYCFLAGS="$(MAC_CFLAGS)" MYLDFLAGS="$(MAC_LDFLAGS)" MYENV="$(MAC_ENV)"
|
||
|
|
||
|
|
||
|
$(CMOD): $(OBJS)
|
||
|
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||
|
|
||
|
clean:
|
||
|
rm -f $(OBJS) $(CMOD)
|
||
|
|
||
|
buffer.o: buffer.c buffer.h io.h timeout.h
|
||
|
io.o: io.c io.h timeout.h
|
||
|
timeout.o: timeout.c timeout.h
|
||
|
usocket.o: usocket.c socket.h io.h timeout.h usocket.h
|
||
|
context.o: context.c context.h
|
||
|
ssl.o: ssl.c socket.h io.h timeout.h usocket.h buffer.h context.h context.c
|