2018-02-26 00:19:44 +01:00
|
|
|
include ../CWConfig.mak
|
|
|
|
-include ../Config.local.mak
|
2018-03-02 00:12:38 +01:00
|
|
|
include ../Macros.mak
|
2014-11-02 07:34:17 +01:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-26 09:04:53 +01:00
|
|
|
LIBDIR := ../../lib
|
|
|
|
LIBARCHDIR := $(LIBDIR)/$(ARCH)
|
2018-02-26 00:19:44 +01:00
|
|
|
OBJDIR := ../../obj/cw/$(ARCH)
|
2015-02-08 12:35:34 +01:00
|
|
|
|
2018-02-26 00:19:44 +01:00
|
|
|
SNAME := $(LIBARCHDIR)/libcw.a
|
|
|
|
DNAME := $(LIBARCHDIR)/libcw.so
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-01 21:33:16 +01:00
|
|
|
LIBS=
|
|
|
|
|
|
|
|
ifeq ($(WITH_OPENSSL),1)
|
|
|
|
CFLAGS+=$(OPENSSL_CFLAGS)
|
|
|
|
CFLAGS+=-DWITH_OPENSSL
|
|
|
|
DTLSOBJS += dtls_openssl.o \
|
|
|
|
dtls_openssl_accept.o \
|
|
|
|
dtls_openssl_connect.o \
|
|
|
|
dtls_openssl_get_cipher.o \
|
|
|
|
dtls_openssl_bio.o
|
|
|
|
LIBS+=-lssl
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_GNUTLS),1)
|
|
|
|
CFLAGS+=$(GNUTLS_CFLAGS)
|
|
|
|
CFLAGS+=-DWITH_GNUTLS
|
|
|
|
DTLSOBJS+= dtls_gnutls.o \
|
|
|
|
dtls_gnutls_accept.o \
|
|
|
|
dtls_gnutls_connect.o \
|
|
|
|
dtls_gnutls_bio.o \
|
|
|
|
dtls_gnutls_get_cipher.o \
|
|
|
|
dtls_gnutls_get_peers_cert.o
|
|
|
|
LIBS+=-lgnutls
|
|
|
|
endif
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-28 09:46:08 +01:00
|
|
|
SRC=$(wildcard *.c)
|
|
|
|
OBJS=$(patsubst %.c,%.o,$(SRC))
|
2018-02-26 00:19:44 +01:00
|
|
|
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
|
2016-02-22 09:18:35 +01:00
|
|
|
|
|
|
|
|
2018-02-26 00:19:44 +01:00
|
|
|
all: $(SNAME) $(DNAME)
|
2016-02-22 09:18:35 +01:00
|
|
|
|
|
|
|
|
2015-02-08 11:42:01 +01:00
|
|
|
CFLAGS += $(GNUTLS_CFLAGS) \
|
|
|
|
-DWITH_CW_LOG \
|
2014-07-11 22:12:11 +02:00
|
|
|
-DWITH_CW_LOG_DEBUG \
|
2018-03-02 00:12:38 +01:00
|
|
|
-DWITH_DTLS
|
2015-02-01 16:49:34 +01:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-26 00:19:44 +01:00
|
|
|
$(OBJDIR)/%.o:%.c
|
|
|
|
@mkdir -p $(OBJDIR)
|
|
|
|
@echo " $(CC) "$<
|
|
|
|
@$(CC) -c $(CFLAGS) $< -o $@
|
2016-02-22 09:18:35 +01:00
|
|
|
|
2018-03-02 00:12:38 +01:00
|
|
|
$(SNAME) : $(OBJS)
|
2018-02-26 00:19:44 +01:00
|
|
|
@mkdir -p $(LIBARCHDIR)
|
2018-03-02 00:12:38 +01:00
|
|
|
@echo " $(AR) $(SNAME)"
|
|
|
|
@$(AR) rcs $(SNAME) $(OBJS)
|
2016-02-22 09:18:35 +01:00
|
|
|
|
2018-03-02 00:12:38 +01:00
|
|
|
$(DNAME) : $(OBJS)
|
2018-02-26 00:19:44 +01:00
|
|
|
@mkdir -p $(LIBARCHDIR)
|
2018-03-02 00:12:38 +01:00
|
|
|
@echo " $(LD) $(DNAME)"
|
|
|
|
@$(LD) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(LIBS)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
SRCS = $(OBJS:.o=.c)
|
|
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: deps clean clean_libs libs
|
|
|
|
|
2016-02-22 18:33:47 +01:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
clean:
|
2018-02-26 00:19:44 +01:00
|
|
|
$(RM) $(OBJDIR)/*
|
|
|
|
$(RM) $(DNAME)
|
|
|
|
$(RM) $(SNAME)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
clean_deps:
|
|
|
|
$(DEPS)
|
|
|
|
|
2016-03-26 09:42:12 +01:00
|
|
|
deps:
|
2018-03-02 18:49:30 +01:00
|
|
|
echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > .depend
|
|
|
|
makedepend $(SRC) -f.depend -p$(OBJDIR)/
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-28 10:54:27 +02:00
|
|
|
-include .depend
|
2018-03-02 18:49:30 +01:00
|
|
|
|