appropriate use of LDFLAGS and LDLIBS

fixes use of implicit make rules for some compilers

closes #539

Change-Id: I43a74ccf8155b1eafe90eba46ce155a2a6301a89
changes/50/21050/1
Richard Fuchs 8 years ago
parent 06f76e6de4
commit 8c770b9e05

@ -84,33 +84,33 @@ CFLAGS+= -DRE_PLUGIN_DIR="\"/usr/lib/rtpengine\""
#CFLAGS+= -DTERMINATE_SDP_AT_BLANK_LINE
#CFLAGS+= -DSTRICT_SDES_KEY_LIFETIME
LDFLAGS= -lm
LDFLAGS+= $(shell pkg-config --libs glib-2.0)
LDFLAGS+= $(shell pkg-config --libs gthread-2.0)
LDFLAGS+= $(shell pkg-config --libs zlib)
LDFLAGS+= $(shell pkg-config --libs libpcre)
LDFLAGS+= $(shell pkg-config --libs libcrypto)
LDFLAGS+= $(shell pkg-config --libs openssl)
LDFLAGS+= $(shell pkg-config --libs libevent_pthreads)
LDFLAGS+= -lpcap
LDFLAGS+= $(shell pcre-config --libs)
LDFLAGS+= $(shell pkg-config xmlrpc_client --libs 2> /dev/null || xmlrpc-c-config client --libs)
LDFLAGS+= $(shell pkg-config xmlrpc --libs 2> /dev/null)
LDFLAGS+= $(shell pkg-config xmlrpc_util --libs 2> /dev/null)
LDFLAGS+= -lhiredis
LDFLAGS+= $(shell pkg-config --libs json-glib-1.0)
LDLIBS= -lm
LDLIBS+= $(shell pkg-config --libs glib-2.0)
LDLIBS+= $(shell pkg-config --libs gthread-2.0)
LDLIBS+= $(shell pkg-config --libs zlib)
LDLIBS+= $(shell pkg-config --libs libpcre)
LDLIBS+= $(shell pkg-config --libs libcrypto)
LDLIBS+= $(shell pkg-config --libs openssl)
LDLIBS+= $(shell pkg-config --libs libevent_pthreads)
LDLIBS+= -lpcap
LDLIBS+= $(shell pcre-config --libs)
LDLIBS+= $(shell pkg-config xmlrpc_client --libs 2> /dev/null || xmlrpc-c-config client --libs)
LDLIBS+= $(shell pkg-config xmlrpc --libs 2> /dev/null)
LDLIBS+= $(shell pkg-config xmlrpc_util --libs 2> /dev/null)
LDLIBS+= -lhiredis
LDLIBS+= $(shell pkg-config --libs json-glib-1.0)
ifeq ($(with_iptables_option),yes)
LDFLAGS+= $(shell pkg-config --libs libiptc)
LDLIBS+= $(shell pkg-config --libs libiptc)
endif
ifeq ($(with_transcoding),yes)
LDFLAGS+= $(shell pkg-config --libs libavcodec)
LDFLAGS+= $(shell pkg-config --libs libavformat)
LDFLAGS+= $(shell pkg-config --libs libavutil)
LDFLAGS+= $(shell pkg-config --libs libswresample)
LDFLAGS+= $(shell pkg-config --libs libavfilter)
LDLIBS+= $(shell pkg-config --libs libavcodec)
LDLIBS+= $(shell pkg-config --libs libavformat)
LDLIBS+= $(shell pkg-config --libs libavutil)
LDLIBS+= $(shell pkg-config --libs libswresample)
LDLIBS+= $(shell pkg-config --libs libavfilter)
endif
ifeq ($(have_bcg729),yes)
LDFLAGS+= $(bcg729_lib)
LDLIBS+= $(bcg729_lib)
endif
SRCS= main.c kernel.c poller.c aux.c control_tcp.c streambuf.c call.c control_udp.c redis.c \

@ -4,7 +4,7 @@ all:
$(MAKE) $(TARGET)
$(TARGET): $(OBJS) .depend Makefile
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
debug:
$(MAKE) DBG=yes all

@ -40,5 +40,6 @@ ifneq ($(DBG),yes)
CFLAGS+= $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS+= $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS+= $(shell dpkg-buildflags --get LDFLAGS)
LDLIBS+= $(shell dpkg-buildflags --get LDLIBS)
endif
endif

@ -13,16 +13,16 @@ CFLAGS+= $(shell pkg-config --cflags libavfilter)
CFLAGS+= $(shell mysql_config --cflags)
CFLAGS+= $(shell pkg-config --cflags openssl)
LDFLAGS= -lm
LDFLAGS+= $(shell pkg-config --libs glib-2.0)
LDFLAGS+= $(shell pkg-config --libs gthread-2.0)
LDFLAGS+= $(shell pkg-config --libs libavcodec)
LDFLAGS+= $(shell pkg-config --libs libavformat)
LDFLAGS+= $(shell pkg-config --libs libavutil)
LDFLAGS+= $(shell pkg-config --libs libswresample)
LDFLAGS+= $(shell pkg-config --libs libavfilter)
LDFLAGS+= $(shell mysql_config --libs)
LDFLAGS+= $(shell pkg-config --libs openssl)
LDLIBS= -lm
LDLIBS+= $(shell pkg-config --libs glib-2.0)
LDLIBS+= $(shell pkg-config --libs gthread-2.0)
LDLIBS+= $(shell pkg-config --libs libavcodec)
LDLIBS+= $(shell pkg-config --libs libavformat)
LDLIBS+= $(shell pkg-config --libs libavutil)
LDLIBS+= $(shell pkg-config --libs libswresample)
LDLIBS+= $(shell pkg-config --libs libavfilter)
LDLIBS+= $(shell mysql_config --libs)
LDLIBS+= $(shell pkg-config --libs openssl)
SRCS= epoll.c garbage.c inotify.c main.c metafile.c stream.c recaux.c packet.c \
decoder.c output.c mix.c db.c log.c forward.c

@ -20,16 +20,16 @@ else
CFLAGS+= -DWITHOUT_CODECLIB
endif
LDFLAGS+= $(shell pkg-config --libs glib-2.0)
LDFLAGS+= $(shell pkg-config --libs gthread-2.0)
LDFLAGS+= $(shell pkg-config --libs libcrypto)
LDFLAGS+= $(shell pkg-config --libs openssl)
LDLIBS+= $(shell pkg-config --libs glib-2.0)
LDLIBS+= $(shell pkg-config --libs gthread-2.0)
LDLIBS+= $(shell pkg-config --libs libcrypto)
LDLIBS+= $(shell pkg-config --libs openssl)
ifeq ($(with_transcoding),yes)
LDFLAGS+= $(shell pkg-config --libs libavcodec)
LDFLAGS+= $(shell pkg-config --libs libavformat)
LDFLAGS+= $(shell pkg-config --libs libavutil)
LDFLAGS+= $(shell pkg-config --libs libswresample)
LDFLAGS+= $(shell pkg-config --libs libavfilter)
LDLIBS+= $(shell pkg-config --libs libavcodec)
LDLIBS+= $(shell pkg-config --libs libavformat)
LDLIBS+= $(shell pkg-config --libs libavutil)
LDLIBS+= $(shell pkg-config --libs libswresample)
LDLIBS+= $(shell pkg-config --libs libavfilter)
endif
SRCS= bitstr-test.c

@ -12,8 +12,8 @@ OBJS_DIR = ../daemon/
OBJS = crypto.o log.o loglib.o
LDFLAGS = $(shell pkg-config --libs glib-2.0)
LDFLAGS += $(shell pkg-config --libs openssl)
LDLIBS = $(shell pkg-config --libs glib-2.0)
LDLIBS += $(shell pkg-config --libs openssl)
CFLAGS = -g $(shell pkg-config --cflags glib-2.0) -D_GNU_SOURCE
@ -30,7 +30,7 @@ sources = t_crypt.c
include $(sources:.c=.d)
t_crypt: t_crypt.o
gcc -o $@ $< $(addprefix $(OBJS_DIR), $(OBJS)) $(LDFLAGS)
gcc $(LDFLAGS) -o $@ $< $(addprefix $(OBJS_DIR), $(OBJS)) $(LDLIBS)
.PHONY: clean

Loading…
Cancel
Save