You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.9 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. # $Id: Makefile,v 1.27 2016/01/13 15:22:11 nanard Exp $
  2. # MiniUPnP project
  3. # author: Thomas Bernard
  4. # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  5. # for use with GNU Make (gmake)
  6. # install with :
  7. # $ PREFIX=/tmp/dummylocation make install
  8. # or
  9. # $ INSTALLPREFIX=/usr/local make install
  10. # or
  11. # make install (miniupnpd will be put in /usr/sbin)
  12. #
  13. # install target is made for linux... sorry BSD users...
  14. #CFLAGS = -g -O0
  15. CFLAGS ?= -Os
  16. CFLAGS += -Wall
  17. CFLAGS += -W -Wstrict-prototypes
  18. CFLAGS += -fno-strict-aliasing -fno-common
  19. CFLAGS += -D_GNU_SOURCE
  20. CFLAGS += -ansi
  21. CC ?= gcc
  22. RM = rm -f
  23. INSTALL = install
  24. OS = $(shell uname -s)
  25. ifeq ($(OS), Linux)
  26. LDLIBS += -lnfnetlink
  27. endif
  28. ifeq ($(DEB_BUILD_ARCH_OS), kfreebsd)
  29. LDLIBS += -lfreebsd-glue
  30. endif
  31. #EXECUTABLES = minissdpd testminissdpd listifaces
  32. EXECUTABLES = minissdpd testminissdpd testcodelength \
  33. showminissdpdnotif
  34. MINISSDPDOBJS = minissdpd.o openssdpsocket.o daemonize.o upnputils.o \
  35. ifacewatch.o getroute.o getifaddr.o asyncsendto.o
  36. TESTMINISSDPDOBJS = testminissdpd.o printresponse.o
  37. SHOWMINISSDPDNOTIFOBJS = showminissdpdnotif.o printresponse.o
  38. ALLOBJS = $(MINISSDPDOBJS) $(TESTMINISSDPDOBJS) \
  39. $(SHOWMINISSDPDNOTIFOBJS) \
  40. testcodelength.o
  41. INSTALLPREFIX ?= $(PREFIX)/usr
  42. SBININSTALLDIR = $(INSTALLPREFIX)/sbin
  43. MANINSTALLDIR = $(INSTALLPREFIX)/share/man
  44. .PHONY: all clean install depend check test
  45. all: $(EXECUTABLES)
  46. test: check
  47. clean:
  48. $(RM) $(ALLOBJS) $(EXECUTABLES)
  49. install: minissdpd
  50. $(INSTALL) -d $(SBININSTALLDIR)
  51. $(INSTALL) minissdpd $(SBININSTALLDIR)
  52. $(INSTALL) -d $(MANINSTALLDIR)/man1
  53. $(INSTALL) minissdpd.1 $(MANINSTALLDIR)/man1/minissdpd.1
  54. ifneq ($(OS), Darwin)
  55. $(INSTALL) -d $(PREFIX)/etc/init.d
  56. $(INSTALL) minissdpd.init.d.script $(PREFIX)/etc/init.d/minissdpd
  57. endif
  58. check: validateminissdpd validatecodelength
  59. validateminissdpd: testminissdpd minissdpd
  60. ./testminissdpd.sh
  61. touch $@
  62. validatecodelength: testcodelength
  63. ./testcodelength
  64. touch $@
  65. minissdpd: $(MINISSDPDOBJS)
  66. testminissdpd: $(TESTMINISSDPDOBJS)
  67. showminissdpdnotif: $(SHOWMINISSDPDNOTIFOBJS)
  68. testcodelength: testcodelength.o
  69. listifaces: listifaces.o upnputils.o
  70. depend:
  71. makedepend -f$(MAKEFILE_LIST) -Y \
  72. $(ALLOBJS:.o=.c) 2>/dev/null
  73. # DO NOT DELETE
  74. minissdpd.o: config.h getifaddr.h upnputils.h openssdpsocket.h
  75. minissdpd.o: minissdpdtypes.h daemonize.h codelength.h ifacewatch.h
  76. minissdpd.o: asyncsendto.h
  77. openssdpsocket.o: config.h openssdpsocket.h minissdpdtypes.h upnputils.h
  78. daemonize.o: daemonize.h config.h
  79. upnputils.o: config.h upnputils.h getroute.h minissdpdtypes.h
  80. ifacewatch.o: config.h openssdpsocket.h minissdpdtypes.h upnputils.h
  81. getroute.o: getroute.h upnputils.h
  82. getifaddr.o: config.h getifaddr.h
  83. asyncsendto.o: asyncsendto.h upnputils.h
  84. testminissdpd.o: codelength.h printresponse.h
  85. printresponse.o: codelength.h
  86. showminissdpdnotif.o: codelength.h printresponse.h
  87. printresponse.o: codelength.h
  88. testcodelength.o: codelength.h