summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-07 23:16:08 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-07 23:16:08 +0200
commitf080365c72a6aecb34e3632df07431b9e1522665 (patch)
tree630a7212a80edf8162567ba2c515960f888a6746
parentbetter check for elements in sink and source (diff)
prepared build system for multiple binaries
-rw-r--r--.gitignore2
-rw-r--r--src/Makefile44
-rwxr-xr-xsrc/configure24
-rw-r--r--src/options.c2
4 files changed, 49 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 11d311f..9b1fb53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,5 +3,5 @@ src/sydra-rtp
src/*.o
src/*.d
src/*.d.*
-src/config.h
+src/config*.h
src/recordings/
diff --git a/src/Makefile b/src/Makefile
index 9db9ead..a45140b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -36,20 +36,24 @@ ifneq ($(MAKECMDGOALS),distclean)
include include.mk
endif
-EXECUTABLE := sydra-rtp
+EXECUTABLE_RTP := sydra-rtp
+EXECUTABLES := $(EXECUTABLE_RTP)
-C_OBJS := log.o \
- options.o \
- utils.o \
- pipelines.o \
- udp.o \
- sydra-rtp.o
+C_OBJS_COMMON := log.o \
+ options.o \
+ utils.o \
+ pipelines.o \
+ udp.o
-C_SRCS := $(C_OBJS:%.o=%.c)
+C_OBJS_RTP := $(C_OBJS_COMMON) \
+ sydra-rtp.o
+
+C_SRCS_RTP := $(C_OBJS_RTP:%.o=%.c)
+C_SRCS := $(C_SRCS_RTP)
.PHONY: clean cleanall distclean manpage install install-bin uninstall remove
-all: $(EXECUTABLE)
+all: $(EXECUTABLES)
%.d: %.c
@set -e; rm -f $@; \
@@ -61,27 +65,27 @@ ifneq ($(MAKECMDGOALS),distclean)
-include $(C_SRCS:%.c=%.d)
endif
-$(EXECUTABLE): $(C_OBJS)
- $(CC) $(C_OBJS) -o $@ $(LDFLAGS)
+$(EXECUTABLE_RTP): $(C_OBJS_RTP)
+ $(CC) $(C_OBJS_RTP) -o $@ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c $<
-strip: $(EXECUTABLE)
- $(STRIP) -s $(EXECUTABLE)
+strip: $(EXECUTABLES)
+ $(STRIP) -s $(EXECUTABLE_RTP)
distclean: clean
find . -name *.o -exec rm -f {} \;
find . -name "*.\~*" -exec rm -rf {} \;
rm -f include.mk
- rm -f config.h
+ rm -f config*.h
clean:
rm -f *.o
rm -f *.d
rm -f *.d.*
- rm -f $(EXECUTABLE)
+ rm -f $(EXECUTABLES)
INSTALL_TARGETS := install-bin
REMOVE_TARGETS := remove-bin
@@ -93,20 +97,20 @@ endif
install: all $(INSTALL_TARGETS)
-install-bin: $(EXECUTABLE)
+install-bin: $(EXECUTABLES)
$(INSTALL) -d $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
+ $(INSTALL) -m 755 $(EXECUTABLE_RTP) $(DESTDIR)$(BINDIR)
install-man: manpage
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man8/
- $(INSTALL) -m 644 ../doc/$(EXECUTABLE).8 $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8
+ $(INSTALL) -m 644 ../doc/$(EXECUTABLE_RTP).8 $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE_RTP).8
uninstall: remove
remove: $(REMOVE_TARGETS)
remove-bin:
- rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
+ rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE_RTP)
remove-man:
- rm -f $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8
+ rm -f $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE_RTP).8
diff --git a/src/configure b/src/configure
index 077ffe4..73a1de7 100755
--- a/src/configure
+++ b/src/configure
@@ -147,7 +147,7 @@ fi
HOSTNAME=`hostname`
DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
-cat > config.h <<EOF
+cat > config-rtp.h <<EOF
/*
* sydra-rtp config header
*
@@ -169,4 +169,26 @@ cat > config.h <<EOF
#endif
EOF
+cat > config-launch.h <<EOF
+/*
+ * sydra-launch config header
+ *
+ * this file was created automatically
+ * do not edit this file directly
+ * use ./configure instead
+ */
+
+#ifndef SYDRA_config_h_INCLUDED
+#define SYDRA_config_h_INCLUDED
+
+#define VERSION_STRING_0 "sydra-launch version $VERSION"
+#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
+
+#define TARGET "$TARGET"
+#define PREFIX "$PREFIX"
+#define BINDIR "$BINDIR"
+
+#endif
+EOF
+
exit 0
diff --git a/src/options.c b/src/options.c
index 33ffee1..9361759 100644
--- a/src/options.c
+++ b/src/options.c
@@ -33,7 +33,7 @@
*/
#include "datatypes.h"
-#include "config.h"
+#include "config-rtp.h"
#include "options.h"
#include "log.h"