2012-09-02 16:15:49 +02:00
|
|
|
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:
|
2012-09-02 16:22:22 +02:00
|
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)"
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
bsd:
|
2012-09-02 16:22:22 +02:00
|
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(BSD_CFLAGS)" MYLDFLAGS="$(BSD_LDFLAGS)"
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
macosx:
|
2012-09-02 16:22:22 +02:00
|
|
|
@$(MAKE) $(CMOD) MYCFLAGS="$(MAC_CFLAGS)" MYLDFLAGS="$(MAC_LDFLAGS)" MYENV="$(MAC_ENV)"
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
$(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
|