From df869fff0f82ee23895e28950538bcb13296752b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 1 Dec 2016 08:53:05 -0500 Subject: [PATCH] automate lib symlink creation in makefiles Change-Id: I5bedecfbe6e7c61bd505c075c4b2cd444cc4cc41 --- daemon/.gitignore | 3 +++ daemon/Makefile | 20 +++++++++++++------- daemon/auxlib.c | 1 - daemon/loglib.c | 1 - daemon/rtplib.c | 1 - recording-daemon/.gitignore | 3 +++ recording-daemon/Makefile | 16 ++++++++++------ recording-daemon/auxlib.c | 1 - recording-daemon/loglib.c | 1 - recording-daemon/rtplib.c | 1 - 10 files changed, 29 insertions(+), 19 deletions(-) delete mode 120000 daemon/auxlib.c delete mode 120000 daemon/loglib.c delete mode 120000 daemon/rtplib.c delete mode 120000 recording-daemon/auxlib.c delete mode 120000 recording-daemon/loglib.c delete mode 120000 recording-daemon/rtplib.c diff --git a/daemon/.gitignore b/daemon/.gitignore index 999f7e326..2d7db3f16 100644 --- a/daemon/.gitignore +++ b/daemon/.gitignore @@ -4,3 +4,6 @@ rtpengine core core.* .ycm_extra_conf.pyc +auxlib.c +loglib.c +rtplib.c diff --git a/daemon/Makefile b/daemon/Makefile index 9828f8939..7eca49501 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -1,3 +1,5 @@ +TARGET= rtpengine + CFLAGS= -g -Wall -pthread -fno-strict-aliasing CFLAGS+= -std=c99 CFLAGS+= `pkg-config --cflags glib-2.0` @@ -34,14 +36,15 @@ include ../lib/lib.Makefile SRCS= main.c kernel.c poller.c aux.c control_tcp.c streambuf.c call.c control_udp.c redis.c \ bencode.c cookie_cache.c udp_listener.c control_ng.c sdp.c str.c stun.c rtcp.c \ crypto.c rtp.c call_interfaces.c dtls.c log.c cli.c graphite.c ice.c socket.c \ - media_socket.c rtcp_xr.c homer.c recording.c rtplib.c loglib.c auxlib.c -OBJS= $(SRCS:.c=.o) + media_socket.c rtcp_xr.c homer.c recording.c +LIBSRCS= loglib.c auxlib.c rtplib.c +OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) .PHONY: all dep clean tests debug all: - $(MAKE) rtpengine + $(MAKE) $(TARGET) debug: $(MAKE) DBG=yes all @@ -49,15 +52,18 @@ debug: dep: .depend clean: - rm -f $(OBJS) rtpengine .depend core core.* + rm -f $(OBJS) $(TARGET) $(LIBSRCS) .depend core core.* -.depend: $(SRCS) Makefile - $(CC) $(CFLAGS) -M $(SRCS) | sed -e 's/:/ .depend:/' > .depend +.depend: $(SRCS) $(LIBSRCS) Makefile + $(CC) $(CFLAGS) -M $(SRCS) $(LIBSRCS) | sed -e 's/:/ .depend:/' > .depend -rtpengine: $(OBJS) .depend Makefile +$(TARGET): $(OBJS) .depend Makefile $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(OBJS): Makefile +$(LIBSRCS): + ln -fs ../lib/$@ + include .depend diff --git a/daemon/auxlib.c b/daemon/auxlib.c deleted file mode 120000 index 16d8d732c..000000000 --- a/daemon/auxlib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/auxlib.c \ No newline at end of file diff --git a/daemon/loglib.c b/daemon/loglib.c deleted file mode 120000 index 165fc5b41..000000000 --- a/daemon/loglib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/loglib.c \ No newline at end of file diff --git a/daemon/rtplib.c b/daemon/rtplib.c deleted file mode 120000 index e6640de16..000000000 --- a/daemon/rtplib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/rtplib.c \ No newline at end of file diff --git a/recording-daemon/.gitignore b/recording-daemon/.gitignore index 16889cdce..860c1f6a8 100644 --- a/recording-daemon/.gitignore +++ b/recording-daemon/.gitignore @@ -4,3 +4,6 @@ core core.* .ycm_extra_conf.pyc rtpengine-recording +auxlib.c +loglib.c +rtplib.c diff --git a/recording-daemon/Makefile b/recording-daemon/Makefile index 6c3488421..d8084154d 100644 --- a/recording-daemon/Makefile +++ b/recording-daemon/Makefile @@ -22,9 +22,10 @@ LDFLAGS+= `pkg-config --libs libavresample` include ../lib/lib.Makefile -SRCS= epoll.c garbage.c inotify.c main.c metafile.c stream.c recaux.c rtplib.c packet.c \ - decoder.c loglib.c auxlib.c output.c -OBJS= $(SRCS:.c=.o) +SRCS= epoll.c garbage.c inotify.c main.c metafile.c stream.c recaux.c packet.c \ + decoder.c output.c +LIBSRCS= loglib.c auxlib.c rtplib.c +OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) .PHONY: all dep clean tests debug @@ -38,15 +39,18 @@ debug: dep: .depend clean: - rm -f $(OBJS) $(TARGET) .depend core core.* + rm -f $(OBJS) $(TARGET) $(LIBSRCS) .depend core core.* -.depend: $(SRCS) Makefile - $(CC) $(CFLAGS) -M $(SRCS) | sed -e 's/:/ .depend:/' > .depend +.depend: $(SRCS) $(LIBSRCS) Makefile + $(CC) $(CFLAGS) -M $(SRCS) $(LIBSRCS) | sed -e 's/:/ .depend:/' > .depend $(TARGET): $(OBJS) .depend Makefile $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(OBJS): Makefile +$(LIBSRCS): + ln -fs ../lib/$@ + include .depend diff --git a/recording-daemon/auxlib.c b/recording-daemon/auxlib.c deleted file mode 120000 index 16d8d732c..000000000 --- a/recording-daemon/auxlib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/auxlib.c \ No newline at end of file diff --git a/recording-daemon/loglib.c b/recording-daemon/loglib.c deleted file mode 120000 index 165fc5b41..000000000 --- a/recording-daemon/loglib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/loglib.c \ No newline at end of file diff --git a/recording-daemon/rtplib.c b/recording-daemon/rtplib.c deleted file mode 120000 index e6640de16..000000000 --- a/recording-daemon/rtplib.c +++ /dev/null @@ -1 +0,0 @@ -../lib/rtplib.c \ No newline at end of file