luasec/src/Makefile

62 lines
1.4 KiB
Makefile
Raw Normal View History

2012-09-02 16:15:49 +02:00
CMOD=ssl.so
LMOD=ssl.lua
OBJS= \
2013-03-30 13:21:40 +01:00
x509.o \
2012-09-02 16:15:49 +02:00
context.o \
ssl.o
2013-03-30 13:21:40 +01:00
LIBS=-lssl -lcrypto -lluasocket
2012-09-02 16:15:49 +02:00
WARN=-Wall -pedantic
BSD_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
BSD_LDFLAGS=-O -fPIC -shared $(LIBDIR)
2012-09-02 16:15:49 +02:00
LNX_CFLAGS=-O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
LNX_LDFLAGS=-O -fPIC -shared $(LIBDIR)
2012-09-02 16:15:49 +02:00
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 ?= /
2012-09-02 16:15:49 +02:00
2013-03-30 13:21:40 +01:00
.PHONY: all clean install none linux bsd macosx luasocket
2012-09-02 16:15:49 +02:00
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
2012-09-02 16:15:49 +02:00
linux:
2013-03-30 13:21:40 +01:00
@$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)" EXTRA="$(EXTRA)"
2012-09-02 16:15:49 +02:00
bsd:
2013-03-30 13:21:40 +01:00
@$(MAKE) $(CMOD) MYCFLAGS="$(BSD_CFLAGS)" MYLDFLAGS="$(BSD_LDFLAGS)" EXTRA="$(EXTRA)"
2012-09-02 16:15:49 +02:00
macosx:
2013-03-30 13:21:40 +01:00
@$(MAKE) $(CMOD) MYCFLAGS="$(MAC_CFLAGS)" MYLDFLAGS="$(MAC_LDFLAGS)" MYENV="$(MAC_ENV)" EXTRA="$(EXTRA)"
2012-09-02 16:15:49 +02:00
2013-03-30 13:21:40 +01:00
luasocket:
@cd luasocket && $(MAKE)
2012-09-02 16:15:49 +02:00
2013-03-30 13:21:40 +01:00
$(CMOD): $(EXTRA) $(OBJS)
2012-09-02 16:15:49 +02:00
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
clean:
2013-03-30 13:21:40 +01:00
cd luasocket && $(MAKE) clean
2012-09-02 16:15:49 +02:00
rm -f $(OBJS) $(CMOD)
2013-03-30 13:21:40 +01:00
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