2012-10-18 06:40:45 +00:00
|
|
|
NACL_BASE= nacl/src
|
|
|
|
include $(NACL_BASE)/nacl.mk
|
2012-10-24 18:00:14 +00:00
|
|
|
SERVAL_BASE=
|
|
|
|
include sourcefiles.mk
|
|
|
|
include headerfiles.mk
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-09-06 03:13:06 +00:00
|
|
|
HAVE_ALSA= @HAVE_ALSA@
|
|
|
|
ifeq (HAVE_ALSA,1)
|
2012-11-22 07:48:00 +00:00
|
|
|
SERVAL_SOURCES+= $(SERVAL_BASE)/audio_alsa.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
HAVE_VOIPTEST= @HAVE_VOIPTEST@
|
|
|
|
ifeq ($(HAVE_VOIPTEST), 1)
|
|
|
|
SERVAL_SOURCES+= $(SERVAL_BASE)/pa_phone.c
|
|
|
|
VOIPTEST_CFLAGS=-DHAVE_VOIPTEST=1
|
2012-09-05 09:23:22 +00:00
|
|
|
endif
|
|
|
|
|
2012-11-22 07:48:00 +00:00
|
|
|
SRCS= $(NACL_SOURCES) $(SERVAL_SOURCES)
|
|
|
|
|
2012-07-29 03:34:03 +00:00
|
|
|
MONITORCLIENTSRCS=conf.c \
|
2012-12-04 03:42:28 +00:00
|
|
|
conf_om.c \
|
|
|
|
conf_parse.c \
|
|
|
|
conf_schema.c \
|
2012-12-09 23:09:15 +00:00
|
|
|
dataformats.c \
|
2012-07-29 03:34:03 +00:00
|
|
|
log.c \
|
2013-03-26 07:54:37 +00:00
|
|
|
xprintf.c \
|
2012-12-03 23:42:35 +00:00
|
|
|
os.c \
|
2012-12-03 23:26:24 +00:00
|
|
|
mem.c \
|
2012-07-29 03:34:03 +00:00
|
|
|
monitor-client.c \
|
2012-12-07 03:39:55 +00:00
|
|
|
instance.c \
|
2012-07-29 03:34:03 +00:00
|
|
|
net.c \
|
2012-08-06 02:55:45 +00:00
|
|
|
str.c \
|
2012-07-29 03:34:03 +00:00
|
|
|
strbuf.c \
|
2013-04-29 05:00:44 +00:00
|
|
|
strbuf_helpers.c \
|
|
|
|
rotbuf.c
|
2012-07-29 03:34:03 +00:00
|
|
|
|
2012-09-14 02:17:48 +00:00
|
|
|
MDPCLIENTSRCS=conf.c \
|
2012-12-04 03:42:28 +00:00
|
|
|
conf_om.c \
|
|
|
|
conf_parse.c \
|
|
|
|
conf_schema.c \
|
2012-09-18 02:56:30 +00:00
|
|
|
dataformats.c \
|
2012-12-03 23:42:35 +00:00
|
|
|
os.c \
|
2012-12-03 23:26:24 +00:00
|
|
|
mem.c \
|
2012-09-14 02:17:48 +00:00
|
|
|
log.c \
|
2013-03-26 07:54:37 +00:00
|
|
|
xprintf.c \
|
2012-09-14 02:17:48 +00:00
|
|
|
mdp_client.c \
|
2012-12-07 03:39:55 +00:00
|
|
|
instance.c \
|
2012-09-14 02:17:48 +00:00
|
|
|
net.c \
|
|
|
|
str.c \
|
|
|
|
strbuf.c \
|
2013-04-29 05:00:44 +00:00
|
|
|
strbuf_helpers.c \
|
|
|
|
rotbuf.c
|
2012-09-14 02:17:48 +00:00
|
|
|
|
2012-04-19 06:18:00 +00:00
|
|
|
OBJS= $(SRCS:.c=.o)
|
2012-11-22 07:48:00 +00:00
|
|
|
SERVAL_OBJS= $(SERVAL_SOURCES:.c=.o)
|
2012-07-29 03:34:03 +00:00
|
|
|
MONITORCLIENTOBJS= $(MONITORCLIENTSRCS:.c=.o)
|
2012-09-14 02:17:48 +00:00
|
|
|
MDPCLIENTOBJS= $(MDPCLIENTSRCS:.c=.o)
|
2012-07-29 03:34:03 +00:00
|
|
|
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-09-05 09:23:22 +00:00
|
|
|
LDFLAGS=@LDFLAGS@ @LIBS@ @PORTAUDIO_LIBS@ @SRC_LIBS@ @SPANDSP_LIBS@ @CODEC2_LIBS@ @PTHREAD_LIBS@
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-10-18 06:40:45 +00:00
|
|
|
CFLAGS= -Isqlite-amalgamation-3070900 @CPPFLAGS@ @CFLAGS@ @PORTAUDIO_CFLAGS@ @SRC_CFLAGS@ @SPANDSP_CFLAGS@ @PTHREAD_CFLAGS@ $(VOIPTEST_CFLAGS) -Inacl/include
|
2012-08-06 07:33:00 +00:00
|
|
|
CFLAGS+=-fPIC
|
2012-06-15 05:31:14 +00:00
|
|
|
CFLAGS+=-Wall -Wno-unused-value
|
2012-09-05 09:23:22 +00:00
|
|
|
# Solaris magic
|
|
|
|
CFLAGS+=-DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1
|
2012-09-06 05:02:17 +00:00
|
|
|
# OSX magic to compensate for the Solaris magic
|
|
|
|
CFLAGS+=-D_DARWIN_C_SOURCE
|
2012-07-29 05:25:10 +00:00
|
|
|
-include Makefile.dbg
|
2012-06-15 05:31:14 +00:00
|
|
|
|
|
|
|
DEFS= @DEFS@
|
2012-04-23 10:47:11 +00:00
|
|
|
|
2013-08-19 07:29:10 +00:00
|
|
|
.PHONY: all test clean
|
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
all: servald libmonitorclient.so libmonitorclient.a test
|
|
|
|
|
2013-08-19 04:26:19 +00:00
|
|
|
test: tfw_createfile directory_service fakeradio
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-08-27 07:33:50 +00:00
|
|
|
sqlite-amalgamation-3070900/sqlite3.o: sqlite-amalgamation-3070900/sqlite3.c
|
2012-05-10 03:53:06 +00:00
|
|
|
@echo CC $<
|
2012-08-27 07:33:50 +00:00
|
|
|
@$(CC) $(CFLAGS) $(DEFS) -c $< -o sqlite-amalgamation-3070900/sqlite3.o
|
2012-04-20 07:40:38 +00:00
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
version.o: *.h *.c version_string.sh
|
|
|
|
@echo CC version_servald.c
|
2013-09-12 07:57:07 +00:00
|
|
|
@V=`./version_string.sh --ignore-untracked` \
|
2013-08-19 04:05:58 +00:00
|
|
|
&& $(CC) -c version_servald.c -o $@ -DSERVALD_VERSION="\"$$V\""
|
|
|
|
|
2012-11-22 07:48:00 +00:00
|
|
|
%.o: %.c
|
2012-05-10 03:53:06 +00:00
|
|
|
@echo CC $<
|
2012-10-18 06:40:45 +00:00
|
|
|
@$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-11-22 07:48:00 +00:00
|
|
|
$(SERVAL_OBJS): $(HDRS)
|
|
|
|
$(MONITORCLIENTOBJS): $(HDRS)
|
|
|
|
$(MDPCLIENTOBJS): $(HDRS)
|
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
servald: $(OBJS) version.o
|
2012-05-10 03:53:06 +00:00
|
|
|
@echo LINK $@
|
2013-08-19 04:05:58 +00:00
|
|
|
@$(CC) $(CFLAGS) -Wall -o $@ $(OBJS) version.o $(LDFLAGS)
|
2012-04-20 07:27:36 +00:00
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
directory_service: $(MDPCLIENTOBJS) version.o directory_service.o
|
2012-09-14 02:20:45 +00:00
|
|
|
@echo LINK $@
|
2013-08-19 04:05:58 +00:00
|
|
|
@$(CC) $(CFLAGS) -Wall -o $@ $(MDPCLIENTOBJS) version.o directory_service.o $(LDFLAGS)
|
2012-09-14 02:20:45 +00:00
|
|
|
|
2012-11-20 03:13:51 +00:00
|
|
|
tfw_createfile: tfw_createfile.o str.o strbuf.o strbuf_helpers.o
|
2012-10-31 07:43:33 +00:00
|
|
|
@echo LINK $@
|
2012-11-20 03:13:51 +00:00
|
|
|
@$(CC) $(CFLAGS) -Wall -o $@ tfw_createfile.o str.o strbuf.o strbuf_helpers.o
|
2012-10-31 07:43:33 +00:00
|
|
|
|
2013-08-19 04:26:19 +00:00
|
|
|
fakeradio: fakeradio.o
|
|
|
|
@echo LINK $@
|
|
|
|
@$(CC) $(CFLAGS) -Wall -o $@ fakeradio.o
|
|
|
|
|
2012-06-15 05:31:14 +00:00
|
|
|
# This does not build on 64 bit elf platforms as NaCL isn't built with -fPIC
|
|
|
|
# DOC 20120615
|
2013-08-19 04:05:58 +00:00
|
|
|
libservald.so: $(OBJS) version.o
|
2012-05-10 03:53:06 +00:00
|
|
|
@echo LINK $@
|
2013-08-19 04:05:58 +00:00
|
|
|
@$(CC) $(CFLAGS) -Wall -shared -o $@ $(OBJS) version.o $(LDFLAGS)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
libmonitorclient.so: $(MONITORCLIENTOBJS) version.o
|
2012-07-29 03:05:53 +00:00
|
|
|
@echo LINK $@
|
2013-08-19 04:05:58 +00:00
|
|
|
@$(CC) $(CFLAGS) -Wall -shared -o $@ $(MONITORCLIENTOBJS) version.o $(LDFLAGS)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2013-08-19 04:05:58 +00:00
|
|
|
libmonitorclient.a: $(MONITORCLIENTOBJS) version.o
|
2012-08-10 05:06:46 +00:00
|
|
|
@echo AR $@
|
2013-08-19 04:05:58 +00:00
|
|
|
@$(AR) -cr $@ $(MONITORCLIENTOBJS) version.o
|
2012-08-10 05:06:46 +00:00
|
|
|
|
2012-05-21 04:23:34 +00:00
|
|
|
clean:
|
2013-08-19 04:05:58 +00:00
|
|
|
@rm -f $(OBJS) \
|
|
|
|
tfw_createfile.o version.o \
|
2013-08-19 04:26:19 +00:00
|
|
|
fakeradio.o fakeradio \
|
2013-08-19 04:05:58 +00:00
|
|
|
tfw_createfile servald \
|
|
|
|
libservald.so libmonitorclient.so libmonitorclient.a
|