2014-11-28 13:26:21 +00:00
|
|
|
# $Id: Makefile,v 1.7 2014/11/28 13:14:19 nanard Exp $
|
2014-11-17 16:29:52 +00:00
|
|
|
|
|
|
|
OS = $(shell uname -s)
|
2014-11-12 15:56:35 +00:00
|
|
|
|
|
|
|
CFLAGS = -O0 -g -DDEBUG
|
2014-11-28 13:26:21 +00:00
|
|
|
# libevent debug
|
2014-11-12 15:56:35 +00:00
|
|
|
CFLAGS += -DUSE_DEBUG
|
|
|
|
|
|
|
|
CFLAGS += -fPIC
|
|
|
|
CFLAGS += -ansi
|
|
|
|
CFLAGS += -Wall -W
|
|
|
|
CFLAGS += -D_BSD_SOURCE
|
2015-10-02 16:53:21 +00:00
|
|
|
ifneq ($(OS), Darwin)
|
|
|
|
ifneq ($(OS), FreeBSD)
|
2014-11-19 14:06:14 +00:00
|
|
|
CFLAGS += -D_POSIX_C_SOURCE=200112L
|
2015-10-02 16:53:21 +00:00
|
|
|
endif
|
|
|
|
endif
|
2014-11-28 13:26:21 +00:00
|
|
|
CFLAGS += -I/usr/local/include
|
2014-11-12 15:56:35 +00:00
|
|
|
|
2014-12-12 18:08:00 +00:00
|
|
|
#CFLAGS += -DENABLE_UPNP_EVENTS
|
|
|
|
|
2015-07-19 13:36:09 +00:00
|
|
|
LDLIBS = -levent
|
2014-11-28 13:26:21 +00:00
|
|
|
LDFLAGS += -L/usr/local/lib
|
2014-11-12 15:56:35 +00:00
|
|
|
|
2014-11-17 16:29:52 +00:00
|
|
|
ifeq ($(OS), Darwin)
|
|
|
|
CFLAGS += -D_DARWIN_C_SOURCE
|
|
|
|
CFLAGS += -I/opt/local/include
|
|
|
|
LDFLAGS += -L/opt/local/lib
|
|
|
|
endif
|
|
|
|
|
2014-11-12 15:56:35 +00:00
|
|
|
LIB = libminiupnpc-ev.a
|
|
|
|
|
|
|
|
LIB_SRCS = miniupnpc-libevent.c minixml.c igd_desc_parse.c upnpreplyparse.c
|
|
|
|
|
|
|
|
SRCS = $(LIB_SRCS) upnpc-libevent.c
|
|
|
|
|
|
|
|
LIB_OBJS = $(patsubst %.c,%.o,$(LIB_SRCS))
|
|
|
|
|
|
|
|
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
|
|
|
|
|
|
|
EXECUTABLE = upnpc-libevent
|
|
|
|
|
|
|
|
.PHONY: all clean depend
|
|
|
|
|
|
|
|
all: $(EXECUTABLE)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS)
|
|
|
|
$(RM) $(EXECUTABLE)
|
2015-06-10 10:15:00 +00:00
|
|
|
$(RM) $(LIB)
|
2014-11-12 15:56:35 +00:00
|
|
|
|
|
|
|
upnpc-libevent: upnpc-libevent.o $(LIB)
|
|
|
|
|
|
|
|
$(LIB): $(LIB_OBJS)
|
|
|
|
$(AR) crs $@ $?
|
|
|
|
|
|
|
|
depend:
|
|
|
|
makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null
|
|
|
|
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
|
|
|
|
|
|
miniupnpc-libevent.o: miniupnpc-libevent.h declspec.h upnpreplyparse.h
|
2014-11-17 16:29:24 +00:00
|
|
|
miniupnpc-libevent.o: minixml.h igd_desc_parse.h
|
2014-11-12 15:56:35 +00:00
|
|
|
minixml.o: minixml.h
|
|
|
|
igd_desc_parse.o: igd_desc_parse.h
|
|
|
|
upnpreplyparse.o: upnpreplyparse.h minixml.h
|
|
|
|
upnpc-libevent.o: miniupnpc-libevent.h declspec.h upnpreplyparse.h
|