Annotation of embedaddon/miniupnpd/Makefile.macosx, revision 1.1.1.2
1.1 misho 1: # MiniUPnP project
2: # http://miniupnp.free.fr/
3: # Author: Thomas Bernard
4: # This Makefile should work for MacOSX
5: #
6: # To install use :
7: # $ PREFIX=/dummyinstalldir make -f Makefile.macosx install
8: # or :
9: # $ make -f Makefile.macosx install
10: #
11: CFLAGS = -Wall -O -g3 -DDEBUG
12: #CFLAGS = -Wall -Os
13: CC = gcc
14: RM = rm -f
15: MV = mv
16: INSTALL = install
17: STRIP = strip
18:
19: # OSNAME and FWNAME are used for building OS or FW dependent code.
20: OSNAME = $(shell uname)
21: ARCH = $(shell uname -p)
22: FWNAME = ipfw
23:
24: STD_OBJS = miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o \
25: upnpredirect.o getifaddr.o daemonize.o upnpglobalvars.o \
26: options.o upnppermissions.o minissdp.o natpmp.o \
1.1.1.2 ! misho 27: upnpevents.o getconnstatus.o upnputils.o
! 28: MAC_OBJS = mac/getifstats.o bsd/ifacewatcher.o
1.1 misho 29: IPFW_OBJS = ipfw/ipfwrdr.o
30: MISC_OBJS = upnpreplyparse.o minixml.o
31:
32: ALL_OBJS = $(STD_OBJS) $(MISC_OBJS) $(MAC_OBJS) $(IPFW_OBJS)
33:
34: TEST_UPNPDESCGEN_OBJS = testupnpdescgen.o upnpdescgen.o
35: TEST_GETIFSTATS_OBJS = testgetifstats.o mac/getifstats.o
36: TEST_UPNPPERMISSIONS_OBJS = testupnppermissions.o upnppermissions.o
37: TEST_GETIFADDR_OBJS = testgetifaddr.o getifaddr.o
38: MINIUPNPDCTL_OBJS = miniupnpdctl.o
39:
40: EXECUTABLES = miniupnpd testupnpdescgen testgetifstats \
41: testupnppermissions miniupnpdctl \
42: testgetifaddr
43:
44: LIBS =
45:
46: # set PREFIX variable to install in the wanted place
47:
48: INSTALL_BINDIR = $(PREFIX)/sbin
49: INSTALL_ETCDIR = $(PREFIX)/etc/miniupnpd
50: # INSTALL_MANDIR = $(PREFIX)/man
51: INSTALL_MANDIR = /usr/share/man/man1
52:
53: all: $(EXECUTABLES)
54:
55: clean:
56: $(RM) $(ALL_OBJS) $(EXECUTABLES) \
57: testupnpdescgen.o testgetifstats.o testupnppermissions.o \
58: miniupnpdctl.o testgetifaddr.o config.h
59:
60: install: miniupnpd genuuid
61: $(STRIP) miniupnpd
62: $(INSTALL) -d $(INSTALL_BINDIR)
63: $(INSTALL) miniupnpd $(INSTALL_BINDIR)
64: $(INSTALL) -d $(INSTALL_ETCDIR)
65: $(INSTALL) ipfw/ipfw_init.sh $(INSTALL_ETCDIR)
66: $(INSTALL) ipfw/ipfw_removeall.sh $(INSTALL_ETCDIR)
67: $(INSTALL) --mode=0644 -b miniupnpd.conf $(INSTALL_ETCDIR)
68: $(INSTALL) -d $(INSTALL_MANDIR)
69: $(INSTALL) miniupnpd.1 $(INSTALL_MANDIR)
70: # TODO Fix these paths and those within the plist
71: $(INSTALL) -d $(PREFIX)/Library/LaunchDaemons
72: $(INSTALL) mac/org.tuxfamily.miniupnpd.plist $(PREFIX)/Library/LaunchDaemons
73:
74: # genuuid is using the uuid cli tool available under MacOSX
75: UUID != if which uuidgen 2>&1 > /dev/null; then \
76: echo `uuidgen` ; \
77: elif which uuid 2>&1 > /dev/null; then \
78: echo `uuid` ; \
79: else echo "00000000-0000-0000-0000-000000000000"; \
80: fi
81:
82: genuuid:
83: $(MV) miniupnpd.conf miniupnpd.conf.before
84: sed -e "s/^uuid=[-0-9a-f]*/uuid=$(UUID)/" miniupnpd.conf.before > miniupnpd.conf
85: $(RM) miniupnpd.conf.before
86:
87: depend: config.h
88: mkdep $(ALL_OBJS:.o=.c) testupnpdescgen.c testgetifstats.c \
89: testupnppermissions.c miniupnpdctl.c testgetifaddr.c
90:
91: miniupnpd: config.h $(ALL_OBJS)
92: $(CC) $(CFLAGS) -o $@ $(ALL_OBJS) $(LIBS)
93:
94: miniupnpdctl: config.h $(MINIUPNPDCTL_OBJS)
95: $(CC) $(CFLAGS) -o $@ $(MINIUPNPDCTL_OBJS)
96:
97: testupnpdescgen: config.h $(TEST_UPNPDESCGEN_OBJS)
98: $(CC) $(CFLAGS) -o $@ $(TEST_UPNPDESCGEN_OBJS)
99:
100: testgetifstats: config.h $(TEST_GETIFSTATS_OBJS)
101: $(CC) $(CFLAGS) -o $@ $(TEST_GETIFSTATS_OBJS) $(LIBS)
102:
103: testgetifaddr: config.h $(TEST_GETIFADDR_OBJS)
104: $(CC) $(CFLAGS) -o $@ $(TEST_GETIFADDR_OBJS)
105:
106: testupnppermissions: config.h $(TEST_UPNPPERMISSIONS_OBJS)
107: $(CC) $(CFLAGS) -o $@ $(TEST_UPNPPERMISSIONS_OBJS)
108:
109:
110: config.h: genconfig.sh
111: ./genconfig.sh
112:
113: .SUFFIXES: .o .c
114: .c.o:
115: $(CC) $(CFLAGS) -c -o $@ $<
116: # $(CC) $(CFLAGS) -c -o $(.TARGET) $(.IMPSRC)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>