1 # should be either OSC_HOST_BIG_ENDIAN or OSC_HOST_LITTLE_ENDIAN
2 # Apple Mac OS X: OSC_HOST_BIG_ENDIAN
3 # Win32: OSC_HOST_LITTLE_ENDIAN
4 # i386 GNU/Linux: OSC_HOST_LITTLE_ENDIAN
5 ENDIANESS
=OSC_HOST_LITTLE_ENDIAN
11 CXXFLAGS
= $(COPTS
) $(INCLUDES
) -D
$(ENDIANESS
)
14 INSTALL
= /usr
/bin
/install -c
17 UNITTESTS
=OscUnitTests
19 RECEIVE
=OscReceiveTest
24 LIBSONAME
= $(LIBNAME
).so
25 LIBFILENAME
= $(LIBSONAME
).1.0.2
27 #Test and example source
28 SENDSOURCES
= .
/tests
/OscSendTests.
cpp .
/osc
/OscOutboundPacketStream.
cpp .
/osc
/OscTypes.
cpp .
/ip
/posix
/NetworkingUtils.
cpp .
/ip
/posix
/UdpSocket.
cpp .
/ip
/IpEndpointName.
cpp
29 SENDOBJECTS
= $(SENDSOURCES
:.
cpp=.o
)
31 RECEIVESOURCES
= .
/tests
/OscReceiveTest.
cpp .
/osc
/OscTypes.
cpp .
/osc
/OscReceivedElements.
cpp .
/osc
/OscPrintReceivedElements.
cpp .
/ip
/posix
/NetworkingUtils.
cpp .
/ip
/posix
/UdpSocket.
cpp
32 RECEIVEOBJECTS
= $(RECEIVESOURCES
:.
cpp=.o
)
34 DUMPSOURCES
= .
/examples
/OscDump.
cpp .
/osc
/OscTypes.
cpp .
/osc
/OscReceivedElements.
cpp .
/osc
/OscPrintReceivedElements.
cpp .
/ip
/posix
/NetworkingUtils.
cpp .
/ip
/posix
/UdpSocket.
cpp
35 DUMPOBJECTS
= $(DUMPSOURCES
:.
cpp=.o
)
37 UNITTESTSOURCES
= .
/tests
/OscUnitTests.
cpp .
/osc
/OscOutboundPacketStream.
cpp .
/osc
/OscTypes.
cpp .
/osc
/OscReceivedElements.
cpp .
/osc
/OscPrintReceivedElements.
cpp
38 UNITTESTOBJECTS
= $(UNITTESTSOURCES
:.
cpp=.o
)
41 LIBSOURCES
= .
/ip
/IpEndpointName.
cpp \
42 .
/ip
/posix
/NetworkingUtils.
cpp .
/ip
/posix
/UdpSocket.
cpp\
43 .
/osc
/OscOutboundPacketStream.
cpp .
/osc
/OscPrintReceivedElements.
cpp .
/osc
/OscReceivedElements.
cpp .
/osc
/OscTypes.
cpp
44 LIBOBJECTS
= $(LIBSOURCES
:.
cpp=.o
)
46 all: unittests send receive dump
48 unittests
: $(UNITTESTOBJECTS
)
49 @if
[ ! -d bin
] ; then mkdir bin
; fi
50 $(CXX
) -o bin
/$(UNITTESTS
) $+ $(LIBS
)
52 @if
[ ! -d bin
] ; then mkdir bin
; fi
53 $(CXX
) -o bin
/$(SEND
) $+ $(LIBS
)
54 receive
: $(RECEIVEOBJECTS
)
55 @if
[ ! -d bin
] ; then mkdir bin
; fi
56 $(CXX
) -o bin
/$(RECEIVE
) $+ $(LIBS
)
58 @if
[ ! -d bin
] ; then mkdir bin
; fi
59 $(CXX
) -o bin
/$(DUMP
) $+ $(LIBS
)
62 rm -rf bin
$(UNITTESTOBJECTS
) $(SENDOBJECTS
) $(RECEIVEOBJECTS
) $(DUMPOBJECTS
) $(LIBOBJECTS
) $(LIBFILENAME
) include lib oscpack
&> /dev
/null
64 $(LIBFILENAME
): $(LIBOBJECTS
)
66 $(CXX
) -shared
-Wl
,-soname
,$(LIBSONAME
) -o
$(LIBFILENAME
) $(LIBOBJECTS
) -lc
68 @
#$(CXX) -dynamiclib -Wl,-install_name,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
72 #Installs the library on a system global location
74 @
$(INSTALL
) -m
755 $(LIBFILENAME
) $(PREFIX
)/lib
/$(LIBFILENAME
)
75 @ln
-s
-f
$(PREFIX
)/lib
/$(LIBFILENAME
) $(PREFIX
)/lib
/$(LIBSONAME
)
76 @mkdir
-p
$(PREFIX
)/include/oscpack
/ip
$(PREFIX
)/include/oscpack
/osc
77 @
$(INSTALL
) -m
644 ip
/*.h
$(PREFIX
)/include/oscpack
/ip
78 @
$(INSTALL
) -m
644 osc
/*.h
$(PREFIX
)/include/oscpack
/osc
79 @echo
"SUCCESS! oscpack has been installed in $(PREFIX)/lib and $(PREFIX)/include/ospack/"
80 @echo
"now doing ldconfig..."
83 #Installs the include/lib structure locally
86 @echo
" Installing in local directory <$(INCLUDEDIR)>"
87 @echo
" > Creating symbolic link"
88 @ln
-s
$(LIBFILENAME
) $(LIBSONAME
)
89 @echo
" > Creating directories"
91 @mkdir
-p oscpack
/include/ip
92 @mkdir
-p oscpack
/include/osc
93 @echo
" > Copying files"
94 @mv
$(LIBFILENAME
) $(LIBSONAME
) oscpack
/lib
95 @cp ip
/*.h oscpack
/include/ip
96 @cp osc
/*.h oscpack
/include/osc