2018-03-20 11:57:44 +01:00
|
|
|
include ../Defs.mak
|
2018-03-12 11:22:06 +01:00
|
|
|
include ../Config.mak
|
2014-09-14 22:46:14 +02:00
|
|
|
include ../WtpConfig.mak
|
2018-03-12 11:22:06 +01:00
|
|
|
-include ../Config.local.mak
|
|
|
|
-include ../WtpConfig.local.mak
|
2015-02-01 16:55:45 +01:00
|
|
|
include ../Macros.mak
|
2014-09-14 22:46:14 +02:00
|
|
|
|
2015-02-08 21:07:55 +01:00
|
|
|
|
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
LIBDIR := ../../lib
|
|
|
|
LIBARCHDIR := $(LIBDIR)/$(ARCH)
|
|
|
|
OBJDIR := ../../obj/wtp/$(ARCH)
|
|
|
|
EXENAME := ./wtp
|
2015-02-08 21:07:55 +01:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
LIBS := -lcw
|
|
|
|
#STATICLIBS := $(LIBDIR)/$(ARCH)/libcw.a
|
|
|
|
LDFLAGS += -L$(LIBARCHDIR)
|
2015-02-08 21:07:55 +01:00
|
|
|
|
|
|
|
ifeq ($(SSL_LIBRARY),GNUTLS)
|
|
|
|
CFLAGS+=-DWITH_GNUTLS
|
|
|
|
CFLAGS+=$(GNUTLS_CFLAGS)
|
|
|
|
LIBS+=$(GNUTLS_LIBS)
|
|
|
|
LDFLAGS+=$(GNUTLS_LDFLAGS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SSL_LIBRARY),OPENSSL)
|
|
|
|
CFLAGS+=-DWITH_OPENSSL
|
|
|
|
CFLAGS+=$(OPESSL_CFLAGS)
|
|
|
|
LDFLAGS+=$(OPENSSL_LDFLAGS)
|
|
|
|
LIBS+=$(OPENSSL_LIBS)
|
2014-07-20 19:32:58 +02:00
|
|
|
endif
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-02-08 21:07:55 +01:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
#SRC=$(wildcard *.c)
|
2018-04-23 07:51:56 +02:00
|
|
|
SRC=wtp_main.c discovery.c join.c configure.c run.c changestate.c
|
2015-02-08 21:07:55 +01:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
OBJS=$(patsubst %.c,%.o,$(SRC))
|
|
|
|
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
|
2016-03-12 22:24:57 +01:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
ALL=$(EXENAME)
|
2014-09-14 22:46:14 +02:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
all: $(ALL)
|
2014-09-14 22:46:14 +02:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
$(OBJDIR)/%.o:%.c
|
|
|
|
@mkdir -p $(OBJDIR)
|
|
|
|
@echo " $(CC) "$<
|
|
|
|
@$(CC) -c $(CFLAGS) $< -o $@
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
$(EXENAME): $(OBJS)
|
|
|
|
@echo " $(LD) $(EXENAME)"
|
|
|
|
@$(LD) $(LDFLAGS) -o $(EXENAME) $(OBJS) $(LIBS) $(STATICLIBS)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
clean:
|
|
|
|
$(RM) $(OBJDIR)/*
|
|
|
|
$(RM) $(EXENAME)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
deps:
|
|
|
|
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
|
|
|
|
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
-include .depend
|