2014-12-06 11:06:13 +00:00
|
|
|
# $Id: Makefile,v 1.23 2014/12/06 10:54:01 nanard Exp $
|
2011-09-28 19:14:08 +00:00
|
|
|
# MiniUPnP project
|
|
|
|
# author: Thomas Bernard
|
|
|
|
# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
|
|
|
# for use with GNU Make (gmake)
|
|
|
|
# install with :
|
|
|
|
# $ PREFIX=/tmp/dummylocation make install
|
|
|
|
# or
|
|
|
|
# $ INSTALLPREFIX=/usr/local make install
|
|
|
|
# or
|
|
|
|
# make install (miniupnpd will be put in /usr/sbin)
|
|
|
|
#
|
|
|
|
# install target is made for linux... sorry BSD users...
|
2014-11-28 16:38:54 +00:00
|
|
|
#CFLAGS = -g -O0
|
2012-05-08 21:06:14 +00:00
|
|
|
CFLAGS ?= -Os
|
|
|
|
CFLAGS += -Wall
|
|
|
|
CFLAGS += -W -Wstrict-prototypes
|
|
|
|
CFLAGS += -fno-strict-aliasing -fno-common
|
|
|
|
CFLAGS += -D_GNU_SOURCE
|
|
|
|
CFLAGS += -ansi
|
2011-09-28 19:14:08 +00:00
|
|
|
CC = gcc
|
|
|
|
RM = rm -f
|
|
|
|
INSTALL = install
|
2011-12-31 19:06:17 +00:00
|
|
|
OS = $(shell uname -s)
|
2011-09-28 19:14:08 +00:00
|
|
|
|
2014-11-28 16:38:54 +00:00
|
|
|
ifeq ($(OS), Linux)
|
|
|
|
LDLIBS += -lnfnetlink
|
|
|
|
endif
|
|
|
|
ifeq ($(DEB_BUILD_ARCH_OS), kfreebsd)
|
|
|
|
LDLIBS += -lfreebsd-glue
|
|
|
|
endif
|
|
|
|
|
2011-09-28 19:14:08 +00:00
|
|
|
#EXECUTABLES = minissdpd testminissdpd listifaces
|
|
|
|
EXECUTABLES = minissdpd testminissdpd testcodelength
|
2014-11-28 16:38:54 +00:00
|
|
|
MINISSDPDOBJS = minissdpd.o openssdpsocket.o daemonize.o upnputils.o \
|
2014-12-05 16:35:34 +00:00
|
|
|
ifacewatch.o getroute.o getifaddr.o asyncsendto.o
|
2011-09-28 19:14:08 +00:00
|
|
|
TESTMINISSDPDOBJS = testminissdpd.o
|
|
|
|
|
|
|
|
ALLOBJS = $(MINISSDPDOBJS) $(TESTMINISSDPDOBJS) testcodelength.o
|
|
|
|
|
|
|
|
INSTALLPREFIX ?= $(PREFIX)/usr
|
|
|
|
SBININSTALLDIR = $(INSTALLPREFIX)/sbin
|
2011-12-31 19:06:17 +00:00
|
|
|
MANINSTALLDIR = $(INSTALLPREFIX)/share/man
|
|
|
|
|
2011-09-28 19:14:08 +00:00
|
|
|
|
|
|
|
.PHONY: all clean install depend
|
|
|
|
|
|
|
|
all: $(EXECUTABLES)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(ALLOBJS) $(EXECUTABLES)
|
|
|
|
|
|
|
|
install: minissdpd
|
|
|
|
$(INSTALL) -d $(SBININSTALLDIR)
|
|
|
|
$(INSTALL) minissdpd $(SBININSTALLDIR)
|
2011-12-31 19:06:17 +00:00
|
|
|
$(INSTALL) -d $(MANINSTALLDIR)/man1
|
|
|
|
$(INSTALL) minissdpd.1 $(MANINSTALLDIR)/man1/minissdpd.1
|
|
|
|
ifneq ($(OS), Darwin)
|
2011-09-28 19:14:08 +00:00
|
|
|
$(INSTALL) -d $(PREFIX)/etc/init.d
|
|
|
|
$(INSTALL) minissdpd.init.d.script $(PREFIX)/etc/init.d/minissdpd
|
2011-12-31 19:06:17 +00:00
|
|
|
endif
|
2011-09-28 19:14:08 +00:00
|
|
|
|
|
|
|
minissdpd: $(MINISSDPDOBJS)
|
|
|
|
|
|
|
|
testminissdpd: $(TESTMINISSDPDOBJS)
|
|
|
|
|
|
|
|
testcodelength: testcodelength.o
|
|
|
|
|
2014-02-03 15:48:51 +00:00
|
|
|
listifaces: listifaces.o upnputils.o
|
|
|
|
|
2011-09-28 19:14:08 +00:00
|
|
|
depend:
|
|
|
|
makedepend -f$(MAKEFILE_LIST) -Y \
|
|
|
|
$(ALLOBJS:.o=.c) 2>/dev/null
|
|
|
|
|
|
|
|
# DO NOT DELETE
|
|
|
|
|
2014-11-28 16:38:54 +00:00
|
|
|
minissdpd.o: config.h getifaddr.h upnputils.h openssdpsocket.h
|
|
|
|
minissdpd.o: minissdpdtypes.h daemonize.h codelength.h ifacewatch.h
|
2014-12-06 11:06:13 +00:00
|
|
|
minissdpd.o: asyncsendto.h
|
2014-11-28 16:38:54 +00:00
|
|
|
openssdpsocket.o: config.h openssdpsocket.h minissdpdtypes.h upnputils.h
|
2011-09-28 19:14:08 +00:00
|
|
|
daemonize.o: daemonize.h config.h
|
2014-11-28 16:38:54 +00:00
|
|
|
upnputils.o: config.h upnputils.h getroute.h minissdpdtypes.h
|
|
|
|
ifacewatch.o: config.h openssdpsocket.h minissdpdtypes.h upnputils.h
|
|
|
|
getroute.o: getroute.h upnputils.h
|
|
|
|
getifaddr.o: config.h getifaddr.h
|
2014-12-06 11:06:13 +00:00
|
|
|
asyncsendto.o: asyncsendto.h upnputils.h
|
2011-09-28 19:14:08 +00:00
|
|
|
testcodelength.o: codelength.h
|