2014-07-11 22:12:11 +02:00
|
|
|
ifndef CC
|
2014-07-20 19:32:58 +02:00
|
|
|
CC=gcc
|
2014-07-11 22:12:11 +02:00
|
|
|
endif
|
|
|
|
|
2014-07-20 09:42:27 +02:00
|
|
|
ifdef INCLUDE_DIR
|
|
|
|
XINCLUDE=-I $(INCLUDE_DIR)
|
|
|
|
endif
|
|
|
|
|
2014-07-20 19:32:58 +02:00
|
|
|
ifdef LIB_DIR
|
|
|
|
XLIB=-L $(LIB_DIR)
|
|
|
|
endif
|
2014-08-21 13:00:32 +02:00
|
|
|
include ../Config.mak
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(USE_CONTRIB_UCI),1)
|
|
|
|
CFLAGS+=-I../contrib/uci
|
|
|
|
endif
|
|
|
|
|
2014-07-20 19:32:58 +02:00
|
|
|
|
|
|
|
WITH_UCI=1
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
CFLAGS+=-DWITH_RMAC_SUPPORT
|
|
|
|
CFLAGS+=-DWITH_IPV6
|
|
|
|
CFLAGS+=-DWITH_CW_LOG
|
|
|
|
CFLAGS+=-DWITH_CW_LOG_DEBUG
|
|
|
|
CFLAGS+=-DWITH_DTLS
|
2014-07-20 19:32:58 +02:00
|
|
|
CFLAGS+=-DWITH_UCI
|
2014-07-20 09:42:27 +02:00
|
|
|
CFLAGS+=$(XINCLUDE)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
ifndef ARCH
|
2014-07-20 07:53:49 +02:00
|
|
|
ARCH = $(shell $(CC) -dumpmachine)
|
2014-07-11 22:12:11 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CFLAGS
|
|
|
|
CFLAGS += -O2 -Wall -g
|
|
|
|
#endif
|
|
|
|
|
|
|
|
LDFLAGS += -L../../src/capwap/$(ARCH)
|
|
|
|
LDFLAGS += -L/usr/local/lib
|
2014-07-20 19:32:58 +02:00
|
|
|
LDFLAGS += -luci
|
|
|
|
LDFLAGS += $(XLIB)
|
2014-07-11 22:12:11 +02:00
|
|
|
#LDFLAGS += -lpthread
|
|
|
|
#LDFLAGS += -lrt
|
|
|
|
|
|
|
|
LIBS+=-lcapwap
|
|
|
|
#LIBS+=-liw
|
|
|
|
LIBS+=-lssl
|
|
|
|
LIBS+=-lcrypto
|
2014-07-20 19:32:58 +02:00
|
|
|
#LIBS+=-lrt
|
|
|
|
ifdef WITH_UCI
|
|
|
|
LIBS+=-luci -lubox
|
|
|
|
else
|
2014-07-11 22:12:11 +02:00
|
|
|
LIBS+=-lconfuse
|
2014-07-20 19:32:58 +02:00
|
|
|
endif
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
CFLAGS += -I../src
|
|
|
|
CFLAGS += -I../src/utils
|
|
|
|
CFLAGS += -I../../src
|
|
|
|
CFLAGS += -I/usr/local/include
|
|
|
|
|
2014-07-20 19:32:58 +02:00
|
|
|
|
|
|
|
|
2014-07-22 07:10:53 +02:00
|
|
|
CONFOBJS = wtp_conf.o
|
|
|
|
|
2014-07-20 19:32:58 +02:00
|
|
|
ifdef WITH_UCI
|
2014-09-06 10:51:05 +02:00
|
|
|
CONFOBJS += conf_uci.o
|
2014-07-20 19:32:58 +02:00
|
|
|
else
|
|
|
|
CONFOBJS += wtp_conf_confuse.o
|
|
|
|
endif
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
OBJS += wtp_main.o
|
2014-07-20 19:32:58 +02:00
|
|
|
|
|
|
|
#OBJS += wtp_conf.o
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
OBJS += discovery.o
|
|
|
|
OBJS += wtp_interface.o
|
|
|
|
OBJS += wtpdrv.o
|
|
|
|
OBJS += join.o
|
|
|
|
OBJS += run.o
|
|
|
|
OBJS += sulking.o
|
2014-07-19 13:26:01 +02:00
|
|
|
OBJS += configure.o
|
2014-07-20 19:32:58 +02:00
|
|
|
OBJS += $(CONFOBJS)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
ALL=wtp
|
|
|
|
|
|
|
|
all: $(ALL)
|
|
|
|
|
2014-08-21 13:00:32 +02:00
|
|
|
Q=
|
2014-07-11 22:12:11 +02:00
|
|
|
E=echo
|
|
|
|
ifeq ($(V), 1)
|
|
|
|
Q=
|
|
|
|
E=true
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
|
|
|
@$(E) " CC " $<
|
|
|
|
|
|
|
|
|
|
|
|
wtp: $(BCHECK) $(OBJS)
|
|
|
|
$(Q)$(CC) $(LDFLAGS) -o wtp $(OBJS) $(LIBS)
|
|
|
|
|
|
|
|
@$(E) " LD " $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
# $(MAKE) -C ../src clean
|
|
|
|
rm -f *.o
|
|
|
|
rm -f *.d
|
|
|
|
|
|
|
|
-include $(OBJS:%.o=%.d)
|