2015-02-01 16:49:34 +01:00
|
|
|
include ../Macros.mak
|
2018-02-26 00:19:44 +01:00
|
|
|
include ../CWConfig.mak
|
|
|
|
-include ../Config.local.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-02-26 00:19:44 +01:00
|
|
|
LDFLAGS+=-g -D_REENTRANT -L/usr/local/lib
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2018-02-28 09:46:08 +01:00
|
|
|
SRC=$(wildcard *.c)
|
|
|
|
OBJS=$(patsubst %.c,%.o,$(SRC))
|
|
|
|
#O:=$(OBJS);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
|
2018-02-28 09:46:08 +01:00
|
|
|
#CFLAGS = -D_XOPEN_SOURCE=500 -std=c90 -pedantic -Wall -fPIC -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I /usr/local/include -I../
|
2018-03-01 20:11:37 +01:00
|
|
|
CFLAGS = -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wall -fPIC -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I /usr/local/include -I../
|
2014-07-11 22:12:11 +02: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 \
|
|
|
|
-DWITH_DTLS \
|
2014-08-16 09:10:38 +02:00
|
|
|
$(XINCLUDE)\
|
2015-02-01 16:49:34 +01:00
|
|
|
-I $(OPENSSLINC)\
|
|
|
|
-Werror
|
|
|
|
|
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-02-26 00:19:44 +01:00
|
|
|
$(SNAME) : $(OBJS) $(MODOBJS)
|
|
|
|
@mkdir -p $(LIBARCHDIR)
|
|
|
|
@echo " AR $(SNAME)"
|
|
|
|
@$(AR) rcs $(SNAME) $(OBJS) $(MODOBJS)
|
2016-02-22 09:18:35 +01:00
|
|
|
|
2018-02-26 00:19:44 +01:00
|
|
|
$(DNAME) : $(OBJS) $(MODOBJS)
|
|
|
|
@mkdir -p $(LIBARCHDIR)
|
2018-02-26 00:50:05 +01:00
|
|
|
@echo " $(CC) $(DNAME)"
|
2018-02-26 00:19:44 +01:00
|
|
|
@$(CC) $(LDFLAGS) -shared -o $(DNAME) $(OBJS) $(MODOBJS) $(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:
|
|
|
|
$(CC) -MM -E *.c $(CFLAGS) > .depend
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-28 10:54:27 +02:00
|
|
|
-include .depend
|