Annotation of embedaddon/miniupnpc/Makefile, revision 1.1.1.1
1.1 misho 1: # $Id: Makefile,v 1.81 2011/06/21 15:24:14 nanard Exp $
2: # MiniUPnP Project
3: # http://miniupnp.free.fr/
4: # (c) 2005-2011 Thomas Bernard
5: # to install use :
6: # $ PREFIX=/tmp/dummylocation make install
7: # or
8: # $ INSTALLPREFIX=/usr/local make install
9: # or
10: # make install (will go to /usr/bin, /usr/lib, etc...)
11: OS = $(shell uname -s)
12: CC ?= gcc
13: #AR = gar
14: #CFLAGS = -O -Wall -g -DDEBUG
15: CFLAGS ?= -O -Wall -DNDEBUG -DMINIUPNPC_SET_SOCKET_TIMEOUT -Wstrict-prototypes
16: # -DNO_GETADDRINFO
17: INSTALL = install
18: SH = /bin/sh
19: JAVA = java
20: # see http://code.google.com/p/jnaerator/
21: JNAERATOR = jnaerator-0.9.3.jar
22: #following libs are needed on Solaris
23: #LDLIBS=-lsocket -lnsl -lresolv
24:
25: # APIVERSION is used to build SONAME
26: APIVERSION = 8
27:
28: SRCS = igd_desc_parse.c miniupnpc.c minixml.c minisoap.c miniwget.c \
29: upnpc.c upnpcommands.c upnpreplyparse.c testminixml.c \
30: minixmlvalid.c testupnpreplyparse.c minissdpc.c \
31: upnperrors.c testigddescparse.c testminiwget.c \
32: connecthostport.c portlistringparse.c receivedata.c
33:
34: LIBOBJS = miniwget.o minixml.o igd_desc_parse.o minisoap.o \
35: miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
36: connecthostport.o portlistingparse.o receivedata.o
37:
38: ifneq ($(OS), AmigaOS)
39: CFLAGS := -fPIC $(CFLAGS)
40: LIBOBJS := $(LIBOBJS) minissdpc.o
41: endif
42:
43: OBJS = $(patsubst %.c,%.o,$(SRCS))
44:
45: # HEADERS to install
46: HEADERS = miniupnpc.h miniwget.h upnpcommands.h igd_desc_parse.h \
47: upnpreplyparse.h upnperrors.h miniupnpctypes.h \
48: portlistingparse.h \
49: declspec.h
50:
51: # library names
52: LIBRARY = libminiupnpc.a
53: ifeq ($(OS), Darwin)
54: SHAREDLIBRARY = libminiupnpc.dylib
55: SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib
56: CFLAGS := -DMACOSX -D_DARWIN_C_SOURCE $(CFLAGS)
57: else
58: SHAREDLIBRARY = libminiupnpc.so
59: SONAME = $(SHAREDLIBRARY).$(APIVERSION)
60: endif
61:
62: EXECUTABLES = upnpc-static
63: EXECUTABLES_ADDTESTS = testminixml minixmlvalid testupnpreplyparse \
64: testigddescparse testminiwget
65:
66: TESTMINIXMLOBJS = minixml.o igd_desc_parse.o testminixml.o
67:
68: TESTMINIWGETOBJS = miniwget.o testminiwget.o connecthostport.o receivedata.o
69:
70: TESTUPNPREPLYPARSE = testupnpreplyparse.o minixml.o upnpreplyparse.o
71:
72: TESTIGDDESCPARSE = testigddescparse.o igd_desc_parse.o minixml.o \
73: miniupnpc.o miniwget.o upnpcommands.o upnpreplyparse.o \
74: minisoap.o connecthostport.o receivedata.o \
75: portlistingparse.o
76:
77: ifneq ($(OS), AmigaOS)
78: EXECUTABLES := $(EXECUTABLES) upnpc-shared
79: TESTMINIWGETOBJS := $(TESTMINIWGETOBJS) minissdpc.o
80: TESTIGDDESCPARSE := $(TESTIGDDESCPARSE) minissdpc.o
81: endif
82:
83: # install directories
84: INSTALLPREFIX ?= $(PREFIX)/usr
85: INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc
86: INSTALLDIRLIB = $(INSTALLPREFIX)/lib
87: INSTALLDIRBIN = $(INSTALLPREFIX)/bin
88:
89: FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES)
90: ifneq ($(OS), AmigaOS)
91: FILESTOINSTALL := $(FILESTOINSTALL) $(SHAREDLIBRARY)
92: endif
93:
94:
95: .PHONY: install clean depend all check everything \
96: installpythonmodule
97: # validateminixml validateminiwget
98:
99: all: $(LIBRARY) $(EXECUTABLES)
100:
101: check: validateminixml validateminiwget
102:
103: everything: all $(EXECUTABLES_ADDTESTS)
104:
105: pythonmodule: $(LIBRARY) miniupnpcmodule.c setup.py
106: python setup.py build
107: touch $@
108:
109: installpythonmodule: pythonmodule
110: python setup.py install
111:
112: validateminixml: minixmlvalid
113: @echo "minixml validation test"
114: ./minixmlvalid
115: touch $@
116:
117: validateminiwget: testminiwget minihttptestserver testminiwget.sh
118: @echo "miniwget validation test"
119: ./testminiwget.sh
120: touch $@
121:
122: clean:
123: $(RM) $(LIBRARY) $(SHAREDLIBRARY) $(EXECUTABLES) $(OBJS) miniupnpcstrings.h
124: # clean python stuff
125: $(RM) pythonmodule validateminixml
126: $(RM) -r build/ dist/
127: #python setup.py clean
128:
129: install: $(FILESTOINSTALL)
130: $(INSTALL) -d $(INSTALLDIRINC)
131: $(INSTALL) -m 644 $(HEADERS) $(INSTALLDIRINC)
132: $(INSTALL) -d $(INSTALLDIRLIB)
133: $(INSTALL) -m 644 $(LIBRARY) $(INSTALLDIRLIB)
134: ifneq ($(OS), AmigaOS)
135: $(INSTALL) -m 644 $(SHAREDLIBRARY) $(INSTALLDIRLIB)/$(SONAME)
136: ln -fs $(SONAME) $(INSTALLDIRLIB)/$(SHAREDLIBRARY)
137: endif
138: $(INSTALL) -d $(INSTALLDIRBIN)
139: ifeq ($(OS), AmigaOS)
140: $(INSTALL) -m 755 upnpc-static $(INSTALLDIRBIN)/upnpc
141: else
142: $(INSTALL) -m 755 upnpc-shared $(INSTALLDIRBIN)/upnpc
143: endif
144: $(INSTALL) -m 755 external-ip.sh $(INSTALLDIRBIN)/external-ip
145:
146: cleaninstall:
147: $(RM) -r $(INSTALLDIRINC)
148: $(RM) $(INSTALLDIRLIB)/$(LIBRARY)
149: $(RM) $(INSTALLDIRLIB)/$(SHAREDLIBRARY)
150:
151: depend:
152: makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null
153:
154: $(LIBRARY): $(LIBOBJS)
155: $(AR) crs $@ $?
156:
157: $(SHAREDLIBRARY): $(LIBOBJS)
158: ifeq ($(OS), Darwin)
159: $(CC) -dynamiclib $(LDFLAGS) -Wl,-install_name,$(SONAME) -o $@ $^
160: else
161: $(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^
162: endif
163:
164: upnpc-static: upnpc.o $(LIBRARY) $(LDLIBS)
165: $(CC) $(LDFLAGS) -o $@ $^
166:
167: upnpc-shared: upnpc.o $(SHAREDLIBRARY) $(LDLIBS)
168: $(CC) $(LDFLAGS) -o $@ $^
169:
170: testminixml: $(TESTMINIXMLOBJS)
171:
172: testminiwget: $(TESTMINIWGETOBJS)
173:
174: minixmlvalid: minixml.o minixmlvalid.o
175:
176: testupnpreplyparse: $(TESTUPNPREPLYPARSE)
177:
178: testigddescparse: $(TESTIGDDESCPARSE)
179:
180: miniupnpcstrings.h: miniupnpcstrings.h.in updateminiupnpcstrings.sh
181: $(SH) updateminiupnpcstrings.sh
182:
183: jar: $(SHAREDLIBRARY)
184: $(JAVA) -jar $(JNAERATOR) -library miniupnpc miniupnpc.h declspec.h upnpcommands.h upnpreplyparse.h igd_desc_parse.h miniwget.h upnperrors.h $(SHAREDLIBRARY) -package fr.free.miniupnp -o . -jar java/miniupnpc_$(OS).jar -v
185:
186: minihttptestserver: minihttptestserver.o
187:
188: # DO NOT DELETE THIS LINE -- make depend depends on it.
189:
190: igd_desc_parse.o: igd_desc_parse.h
191: miniupnpc.o: miniupnpc.h declspec.h igd_desc_parse.h minissdpc.h miniwget.h
192: miniupnpc.o: minisoap.h minixml.h upnpcommands.h upnpreplyparse.h
193: miniupnpc.o: portlistingparse.h miniupnpctypes.h connecthostport.h
194: miniupnpc.o: receivedata.h
195: minixml.o: minixml.h
196: minisoap.o: minisoap.h miniupnpcstrings.h
197: miniwget.o: miniupnpcstrings.h miniwget.h declspec.h connecthostport.h
198: miniwget.o: receivedata.h
199: upnpc.o: miniwget.h declspec.h miniupnpc.h igd_desc_parse.h upnpcommands.h
200: upnpc.o: upnpreplyparse.h portlistingparse.h miniupnpctypes.h upnperrors.h
201: upnpcommands.o: upnpcommands.h upnpreplyparse.h portlistingparse.h declspec.h
202: upnpcommands.o: miniupnpctypes.h miniupnpc.h igd_desc_parse.h
203: upnpreplyparse.o: upnpreplyparse.h minixml.h
204: testminixml.o: minixml.h igd_desc_parse.h
205: minixmlvalid.o: minixml.h
206: testupnpreplyparse.o: upnpreplyparse.h
207: minissdpc.o: minissdpc.h miniupnpc.h declspec.h igd_desc_parse.h codelength.h
208: upnperrors.o: upnperrors.h declspec.h upnpcommands.h upnpreplyparse.h
209: upnperrors.o: portlistingparse.h miniupnpctypes.h miniupnpc.h
210: upnperrors.o: igd_desc_parse.h
211: testigddescparse.o: igd_desc_parse.h minixml.h miniupnpc.h declspec.h
212: testminiwget.o: miniwget.h declspec.h
213: connecthostport.o: connecthostport.h
214: receivedata.o: receivedata.h
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>