serval-dna/Makefile.in
Andrew Bettison 92253ca97d Revive config_test.c
Move config-dependent code (recvwithttl) from net.c to mdp_net.c (new)

Move log-implementation-independent code from log.c to log_util.c (new)

Build config_test binary in Makefile
2013-11-21 16:05:17 +10:30

141 lines
3.6 KiB
Makefile

NACL_BASE= nacl/src
include $(NACL_BASE)/nacl.mk
SERVAL_BASE=
include sourcefiles.mk
include headerfiles.mk
HAVE_ALSA= @HAVE_ALSA@
ifeq (HAVE_ALSA,1)
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
endif
SRCS= $(NACL_SOURCES) $(SERVAL_SOURCES)
MONITORCLIENTSRCS=conf.c \
conf_om.c \
conf_parse.c \
conf_schema.c \
dataformats.c \
log.c \
log_util.c \
xprintf.c \
os.c \
mem.c \
monitor-client.c \
instance.c \
net.c \
socket.c \
str.c \
strbuf.c \
strbuf_helpers.c \
rotbuf.c
MDPCLIENTSRCS=conf.c \
conf_om.c \
conf_parse.c \
conf_schema.c \
dataformats.c \
os.c \
mem.c \
log.c \
log_util.c \
xprintf.c \
mdp_client.c \
instance.c \
net.c \
mdp_net.c \
socket.c \
str.c \
strbuf.c \
strbuf_helpers.c \
rotbuf.c
OBJS= $(SRCS:.c=.o)
SERVAL_OBJS= $(SERVAL_SOURCES:.c=.o)
MONITORCLIENTOBJS= $(MONITORCLIENTSRCS:.c=.o)
MDPCLIENTOBJS= $(MDPCLIENTSRCS:.c=.o)
LDFLAGS=@LDFLAGS@ @LIBS@ @PORTAUDIO_LIBS@ @SRC_LIBS@ @SPANDSP_LIBS@ @CODEC2_LIBS@ @PTHREAD_LIBS@
CFLAGS= -Isqlite-amalgamation-3070900 @CPPFLAGS@ @CFLAGS@ @PORTAUDIO_CFLAGS@ @SRC_CFLAGS@ @SPANDSP_CFLAGS@ @PTHREAD_CFLAGS@ $(VOIPTEST_CFLAGS) -Inacl/include
CFLAGS+=-fPIC
CFLAGS+=-Wall -Wno-unused-value
# Solaris magic
CFLAGS+=-DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1
# OSX magic to compensate for the Solaris magic
CFLAGS+=-D_DARWIN_C_SOURCE
-include Makefile.dbg
DEFS= @DEFS@
.PHONY: all test clean
all: servald libmonitorclient.so libmonitorclient.a test
test: tfw_createfile directory_service fakeradio config_test
sqlite-amalgamation-3070900/sqlite3.o: sqlite-amalgamation-3070900/sqlite3.c
@echo CC $<
@$(CC) $(CFLAGS) $(DEFS) -c $< -o sqlite-amalgamation-3070900/sqlite3.o
version.o: *.h *.c version_string.sh
@echo CC version_servald.c
@V=`./version_string.sh --ignore-untracked` \
&& $(CC) -c version_servald.c -o $@ -DSERVALD_VERSION="\"$$V\""
%.o: %.c
@echo CC $<
@$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
$(SERVAL_OBJS): $(HDRS)
$(MONITORCLIENTOBJS): $(HDRS)
$(MDPCLIENTOBJS): $(HDRS)
servald: $(OBJS) version.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -o $@ $(OBJS) version.o $(LDFLAGS)
directory_service: $(MDPCLIENTOBJS) version.o directory_service.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -o $@ $(MDPCLIENTOBJS) version.o directory_service.o $(LDFLAGS)
tfw_createfile: tfw_createfile.o str.o strbuf.o strbuf_helpers.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -o $@ tfw_createfile.o str.o strbuf.o strbuf_helpers.o
fakeradio: fakeradio.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -o $@ fakeradio.o
config_test: config_test.o conf_om.o conf_schema.o conf_parse.o str.o strbuf.o strbuf_helpers.o mem.o dataformats.o net.o log_util.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -o $@ config_test.o conf_om.o conf_schema.o conf_parse.o str.o strbuf.o strbuf_helpers.o mem.o dataformats.o net.o log_util.o
# This does not build on 64 bit elf platforms as NaCL isn't built with -fPIC
# DOC 20120615
libservald.so: $(OBJS) version.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -shared -o $@ $(OBJS) version.o $(LDFLAGS)
libmonitorclient.so: $(MONITORCLIENTOBJS) version.o
@echo LINK $@
@$(CC) $(CFLAGS) -Wall -shared -o $@ $(MONITORCLIENTOBJS) version.o $(LDFLAGS)
libmonitorclient.a: $(MONITORCLIENTOBJS) version.o
@echo AR $@
@$(AR) -cr $@ $(MONITORCLIENTOBJS) version.o
clean:
@rm -f $(OBJS) \
tfw_createfile.o version.o \
fakeradio.o fakeradio \
tfw_createfile servald \
libservald.so libmonitorclient.so libmonitorclient.a