cmake mac standalone build: copy 'Standalone Resources' files into the built app
[supercollider.git] / external_libraries / oscpack / Makefile
blob5d0ed94c9d48e844316da41ecdffb07f7d09cb81
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
7 CXX = g++
8 INCLUDES = -I./
9 COPTS = -Wall -O3
10 CDEBUG = -Wall -g
11 CXXFLAGS = $(COPTS) $(INCLUDES) -D$(ENDIANESS)
13 PREFIX = /usr/local
14 INSTALL = /usr/bin/install -c
16 #Name definitions
17 UNITTESTS=OscUnitTests
18 SEND=OscSendTests
19 RECEIVE=OscReceiveTest
20 DUMP=OscDump
22 INCLUDEDIR = oscpack
23 LIBNAME = liboscpack
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)
40 #Library sources
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)
51 send : $(SENDOBJECTS)
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)
57 dump : $(DUMPOBJECTS)
58 @if [ ! -d bin ] ; then mkdir bin ; fi
59 $(CXX) -o bin/$(DUMP) $+ $(LIBS)
61 clean:
62 rm -rf bin $(UNITTESTOBJECTS) $(SENDOBJECTS) $(RECEIVEOBJECTS) $(DUMPOBJECTS) $(LIBOBJECTS) $(LIBFILENAME) include lib oscpack &> /dev/null
64 $(LIBFILENAME): $(LIBOBJECTS)
65 @#GNU/Linux case
66 $(CXX) -shared -Wl,-soname,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
67 @#Mac OS X case
68 @#$(CXX) -dynamiclib -Wl,-install_name,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
70 lib: $(LIBFILENAME)
72 #Installs the library on a system global location
73 install: lib
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..."
81 @ldconfig
83 #Installs the include/lib structure locally
84 install-local: lib
85 @echo ""
86 @echo " Installing in local directory <$(INCLUDEDIR)>"
87 @echo " > Creating symbolic link"
88 @ln -s $(LIBFILENAME) $(LIBSONAME)
89 @echo " > Creating directories"
90 @mkdir -p oscpack/lib
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
97 @echo ""
98 @echo " > Success!"