2 # Choose the installation location
5 subprojects
:= ..
/common ..
/tests ..
/example-clients alsa
7 sources
:= $(wildcard *.
cpp) $(wildcard */*.
cpp) $(wildcard ..
/common
/*.
cpp) $(wildcard ..
/tests
/*.
cpp)
9 TARGET_LINUX_SERVER
:= jackdmp
11 TARGET_LINUX_SERVER_LIB
:= libjackdmp.so
13 TARGET_LINUX_CLIENT_LIB
:= libjackmp.so
15 TARGET_LINUX_ALSA
:= jack_alsa.so
17 TARGET_LINUX_DUMMY
:= jack_dummy.so
19 VPATH
:= $(subprojects
)
21 LIB_LINUX
:= -lpthread
-lrt
-lasound
24 objects_common_server_lib
:= JackActivationCount.o JackAPI.o JackAudioDriver.o JackClient.o JackConnectionManager.o \
25 JackDriver.o JackEngine.o JackEngineTiming.o JackError.o JackExternalClient.o JackFrameTimer.o \
26 JackFreewheelDriver.o JackGlobalsServer.o JackGraphManager.o JackInternalClient.o JackPort.o JackPosixSemaphore.o JackPosixThread.o JackFifo.o JackLoopbackDriver.o\
27 JackServer.o JackShmMem.o JackThreadedDriver.o shm.o JackSocket.o JackSocketServerChannel.o JackSocketNotifyChannel.o \
28 JackSocketServerNotifyChannel.o JackTime.o JackServerAPI.o JackGlobals.o JackDriverLoader.o internal_metro.o JackDebugClient.o JackTransportEngine.o JackServerGlobals.o
30 objects_common_client_lib
:= JackActivationCount.o JackAPI.o JackClient.o JackConnectionManager.o ringbuffer.o \
31 JackError.o JackFrameTimer.o JackGlobalsClient.o JackGraphManager.o JackLibClient.o JackLibAPI.o JackPort.o JackPosixSemaphore.o JackFifo.o \
32 JackPosixThread.o JackShmMem.o shm.o JackSocket.o JackSocketClientChannel.o JackTime.o JackGlobals.o JackDebugClient.o JackTransportEngine.o
35 objects_linux_server
:= Jackdmp.o
37 objects_linux_alsa
:= JackAlsaDriver.o memops.o generic_hw.o hdsp.o hammerfall.o ice1712.o
39 objects_linux_dummy
:= JackDummyDriver.o
41 CFLAGS
:= -g
-O3
-fPIC
-DUSE_POSIX_SHM
$(addprefix -I
, $(subprojects
)) $(CFLAGS
)
42 CXXFLAGS
:= -g
-O3
-fPIC
-DSOCKET_RPC_FIFO_SEMA
-D__SMP__
-DADDON_DIR
=\"$(prefix)\" $(addprefix -I
, $(subprojects
)) $(CXXFLAGS
)
44 #CFLAGS := -g -fPIC -DUSE_POSIX_SHM $(addprefix -I, $(subprojects)) $(CFLAGS)
45 #CXXFLAGS := -g -fPIC -DSOCKET_RPC_FIFO_SEMA -D__SMP__ -DADDON_DIR=\"$(prefix)\" $(addprefix -I, $(subprojects)) $(CXXFLAGS)
47 # Use this line to compile with POSIX names semaphore
48 #CXXFLAGS := -g -03 -fPIC -DSOCKET_RPC_POSIX_SEMA -D__SMP__ -DADDON_DIR=\"$(prefix)\" $(addprefix -I, $(subprojects)) $(CXXFLAGS)
50 # Add the -D__CLIENTDEBUG__ flag to activate client validation
53 linux
: $(TARGET_LINUX_SERVER_LIB
) $(TARGET_LINUX_CLIENT_LIB
) $(TARGET_LINUX_SERVER
) $(TARGET_LINUX_ALSA
) $(TARGET_LINUX_DUMMY
) \
54 synchroClient synchroServer synchroServerClient testSem jack_test
56 all : $(TARGET_LINUX_SERVER
) $(TARGET_LINUX_SERVER_LIB
) $(TARGET_LINUX_ALSA
) $(TARGET_LINUX_DUMMY
)
58 synchroClient
: JackPosixSemaphore.o testSynchroClient.o JackPosixThread.o JackError.o JackFifo.o
59 $(CXX
) $(CXXFLAGS
) JackPosixSemaphore.o testSynchroClient.o JackPosixThread.o JackError.o JackFifo.o
$(LIB_LINUX
) -o synchroClient
61 synchroServer
: JackPosixSemaphore.o testSynchroServer.o JackPosixThread.o JackError.o JackFifo.o
62 $(CXX
) $(CXXFLAGS
) JackPosixSemaphore.o testSynchroServer.o JackPosixThread.o JackError.o JackFifo.o
$(LIB_LINUX
) -o synchroServer
64 synchroServerClient
: JackPosixSemaphore.o testSynchroServerClient.o JackPosixThread.o JackError.o JackFifo.o JackPthreadCond.o JackShmMem.o shm.o
65 $(CXX
) $(CXXFLAGS
) JackPosixSemaphore.o testSynchroServerClient.o JackPosixThread.o JackError.o JackFifo.o JackShmMem.o shm.o JackPthreadCond.o
$(LIB_LINUX
) -o synchroServerClient
67 testSem
: JackPosixSemaphore.o testSem.o JackPosixThread.o JackError.o JackFifo.o
68 $(CXX
) $(CXXFLAGS
) JackPosixSemaphore.o testSem.o JackPosixThread.o JackError.o JackFifo.o
$(LIB_LINUX
) -o testSem
70 jack_test
: jack_test.o
71 $(CXX
) $(CXXFLAGS
) jack_test.o
-L.
-ljackmp
-o jack_test
74 $(TARGET_LINUX_SERVER_LIB
) : $(objects_common_server_lib
)
75 $(CXX
) $(CXXFLAGS
) -shared
$(objects_common_server_lib
) $(LIB_LINUX
) -o
$(TARGET_LINUX_SERVER_LIB
)
77 $(TARGET_LINUX_CLIENT_LIB
) : $(objects_common_client_lib
) $(objects_linux_lib
)
78 $(CXX
) $(CXXFLAGS
) -shared
$(objects_common_client_lib
) $(objects_linux_lib
) $(LIB_LINUX
) -o
$(TARGET_LINUX_CLIENT_LIB
)
80 $(TARGET_LINUX_SERVER
) : $(objects_linux_server
)
81 $(CXX
) $(CXXFLAGS
) $(objects_linux_server
) $(LIB_LINUX
) libjackdmp.so
-o
$(TARGET_LINUX_SERVER
)
83 $(TARGET_LINUX_ALSA
) : $(objects_linux_alsa
)
84 $(CXX
) $(CXXFLAGS
) -shared
$(objects_linux_alsa
) $(LIB_LINUX
) libjackdmp.so
-o
$(TARGET_LINUX_ALSA
)
86 $(TARGET_LINUX_DUMMY
) : $(objects_linux_dummy
)
87 $(CXX
) $(CXXFLAGS
) -shared
$(objects_linux_dummy
) $(LIB_LINUX
) libjackdmp.so
-o
$(TARGET_LINUX_DUMMY
)
90 # Install jackdmp and overwrite jack installation
92 cp jackdmp
$(prefix)/bin
93 cp libjackmp.so
$(prefix)/lib
94 cp libjackdmp.so
$(prefix)/lib
95 install -d
$(prefix)/lib
/jackmp
/
96 cp jack_alsa.so
$(prefix)/lib
/jackmp
97 cp jack_dummy.so
$(prefix)/lib
/jackmp
98 cd
$(prefix)/lib
&& [ -f libjack.so
.0.0.23 ] && mv
-f libjack.so
.0.0.23 tmp_libjack.so
.0.0.23 || echo
"Jack not found, continue..."
99 cd
$(prefix)/lib
&& rm -f libjack.so
*
100 cd
$(prefix)/lib
&& ln
-s libjackmp.so libjack.so
101 cd
$(prefix)/lib
&& ln
-s libjackmp.so libjack.so
.0
105 # Remove jackdmp and tries to restore jack
107 rm $(prefix)/bin
/jackdmp
108 rm $(prefix)/lib
/libjackmp.so
109 rm $(prefix)/lib
/libjackdmp.so
110 rm -r
$(prefix)/lib
/jackmp
111 cd
$(prefix)/lib
&& rm -f libjack.so
*
112 cd
$(prefix)/lib
&& [ -f tmp_libjack.so
.0.0.23 ] && mv
-f tmp_libjack.so
.0.0.23 libjack.so
.0.0.23 \
113 && ln
-s libjack.so
.0.0.23 libjack.so
&& ln
-s libjack.so
.0.0.23 libjack.so
.0 || echo
"Jack not restored"
119 rm -f
$(TARGET_LINUX_SERVER
) $(TARGET_LINUX_SERVER_LIB
) $(TARGET_LINUX_CLIENT_LIB
) $(TARGET_LINUX_ALSA
) $(TARGET_LINUX_DUMMY
) \
120 synchroClient synchroServer synchroServerClient testSem jack_test
123 #makedepend -w120 -Y -- $(CXXFLAGS) -- $(sources)