Browse Source

MT#63151 remove duplication of files during make

Change-Id: I67f45a52660b089748c4f6f76c564bbc97fa1899
pull/1987/head
Richard Fuchs 5 months ago
parent
commit
4cfaf1a3cf
12 changed files with 54 additions and 166 deletions
  1. +0
    -24
      daemon/.gitignore
  2. +0
    -1
      daemon/Makefile
  3. +3
    -0
      lib/.gitignore
  4. +38
    -26
      lib/common.Makefile
  5. +1
    -0
      lib/lib.Makefile
  6. +0
    -14
      perf-tester/.gitignore
  7. +1
    -3
      perf-tester/Makefile
  8. +0
    -20
      recording-daemon/.gitignore
  9. +0
    -1
      recording-daemon/Makefile
  10. +0
    -62
      t/.gitignore
  11. +8
    -11
      t/Makefile
  12. +3
    -4
      utils/build_test_wrapper

+ 0
- 24
daemon/.gitignore View File

@ -5,27 +5,3 @@ rtpengine
core
core.*
.ycm_extra_conf.pyc
auxlib.c
loglib.c
rtplib.c
codeclib.c
resample.c
str.c
fix_frame_channel_layout.h
socket.c
streambuf.c
ssllib.c
dtmflib.c
*-test
dtmf_rx_fillin.h
*-test.c
spandsp_logging.h
mvr2s_x64_avx512.S
mvr2s_x64_avx2.S
mix_buffer.c
mix_in_x64_avx2.S
mix_in_x64_avx512bw.S
mix_in_x64_sse2.S
poller.c
bufferpool.c
uring.c

+ 0
- 1
daemon/Makefile View File

@ -112,7 +112,6 @@ endif
ifneq ($(have_liburing),yes)
LIBSRCS+= uring.c
endif
OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) $(LIBASM:.S=.o)
MDS= rtpengine.ronn
MANS= $(MDS:.ronn=.8)


+ 3
- 0
lib/.gitignore View File

@ -1 +1,4 @@
*.o
dtmf_rx_fillin.h
fix_frame_channel_layout.h
spandsp_logging.h

+ 38
- 26
lib/common.Makefile View File

@ -8,36 +8,48 @@ LDLIBS += -latomic
all: $(TARGET) $(MANS)
$(TARGET): $(OBJS) Makefile
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
OBJS = $(SRCS:.c=.o)
LIBOBJS = $(LIBSRCS:.c=.o)
DAEMONOBJS = $(DAEMONSRCS:.c=.o)
LIBASMOBJS = $(LIBASM:.S=.o)
ALLOBJS = $(OBJS) $(LIBOBJS) $(LIBASMOBJS) $(DAEMONOBJS)
$(OBJS): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
$(LIBOBJS): %.o: ../lib/%.c
$(CC) -c $(CFLAGS) $< -o $@
$(DAEMONOBJS): %.o: ../daemon/%.c
$(CC) -c $(CFLAGS) $< -o $@
$(LIBASMOBJS): %.o: ../lib/%.S
$(AS) -c $(ASFLAGS) $< -o $@
$(TARGET): $(ALLOBJS) Makefile
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(ALLOBJS) $(LDLIBS)
debug:
$(MAKE) DBG=yes all
BUILD_TEST_ALTS = fix_frame_channel_layout.h dtmf_rx_fillin.h spandsp_logging.h
BUILD_TEST_ALTS = ../lib/fix_frame_channel_layout.h ../lib/dtmf_rx_fillin.h ../lib/spandsp_logging.h
clean:
rm -f $(OBJS) $(TARGET) $(LIBSRCS) $(LIBASM) $(DAEMONSRCS) $(MANS) $(ADD_CLEAN) core core.*
rm -f $(BUILD_TEST_ALTS) $(BUILD_TEST_ALTS:.h=-test.c) $(BUILD_TEST_ALTS:.h=-test) *.strhash.c $(HASHSRCS)
rm -f $(ALLOBJS) $(TARGET) $(LIBSRCS) $(LIBASM) $(DAEMONSRCS) $(MANS) $(ADD_CLEAN) core core.*
rm -f $(BUILD_TEST_ALTS) $(BUILD_TEST_ALTS:.h=-test) *.strhash.c
install:
$(OBJS): Makefile ../include/* ../lib/*.h ../kernel-module/*.h
$(LIBSRCS): $(patsubst %,../lib/%,$(LIBSRCS))
( echo '/******** GENERATED FILE ********/' && \
echo '#line 1' && \
cat ../lib/"$@" ) > "$@"
$(LIBASM): $(patsubst %,../lib/%,$(LIBASM))
( echo '/******** GENERATED FILE ********/' && \
echo '#line 1' && \
cat ../lib/"$@" ) > "$@"
$(DAEMONSRCS) $(HASHSRCS): $(patsubst %,../daemon/%,$(DAEMONSRCS)) $(patsubst %,../daemon/%,$(HASHSRCS))
( echo '/******** GENERATED FILE ********/' && \
echo '#line 1' && \
cat ../daemon/"$@" ) > "$@"
$(ALLOBJS): Makefile ../include/* ../lib/*.h ../kernel-module/*.h
%.8: ../docs/%.md
cat "$<" | sed '/^# /d; s/^##/#/' | \
@ -46,19 +58,19 @@ $(DAEMONSRCS) $(HASHSRCS): $(patsubst %,../daemon/%,$(DAEMONSRCS)) $(patsubst %,
-M "date:$(BUILD_DATE)" \
-o "$@"
resample.c codeclib.strhash.c mix.c packet.c: fix_frame_channel_layout.h
resample.c ../lib/codeclib.strhash.c mix.c packet.c: ../lib/fix_frame_channel_layout.h
ifeq ($(with_transcoding),yes)
codec.c: dtmf_rx_fillin.h
media_player.c codec.c test-resample.c: fix_frame_channel_layout.h
../daemon/codec.c codec.c: ../lib/dtmf_rx_fillin.h
media_player.c ../daemon/media_player.c ../daemon/codec.c codec.c test-resample.c: ../lib/fix_frame_channel_layout.h
endif
t38.c: spandsp_logging.h
t38.c ../daemon/t38.c: ../lib/spandsp_logging.h
%.strhash.c: %.c ../utils/const_str_hash
../utils/const_str_hash "$<" $(CFLAGS) < "$<" > "$@"
$(BUILD_TEST_ALTS): $(wildcard ../lib/$(subst .h,-*,$(BUILD_TEST_ALTS)))
$(BUILD_TEST_ALTS): $(wildcard $(subst .h,-*,$(BUILD_TEST_ALTS)))
../utils/build_test_wrapper "$@" 2> /dev/null
.PHONY: all debug clean install

+ 1
- 0
lib/lib.Makefile View File

@ -1,4 +1,5 @@
CC ?= gcc
AS ?= gcc
ifeq ($(DO_ASAN_FLAGS),1)
ASAN_FLAGS = -ggdb -O0 -fsanitize=address -fsanitize=leak -fsanitize=undefined


+ 0
- 14
perf-tester/.gitignore View File

@ -4,17 +4,3 @@ rtpengine-perftest
core
core.*
.ycm_extra_conf.pyc
auxlib.c
loglib.c
rtplib.c
codeclib.c
resample.c
str.c
fix_frame_channel_layout.h
mvr2s_x64_avx512.S
mvr2s_x64_avx2.S
dtmflib.c
poller.c
ssllib.c
bufferpool.c
uring.c

+ 1
- 3
perf-tester/Makefile View File

@ -58,11 +58,9 @@ LIBSRCS = codeclib.strhash.c loglib.c auxlib.c resample.c str.c dtmflib.c rtplib
bencode.c uring.c
LIBASM = mvr2s_x64_avx2.S mvr2s_x64_avx512.S
OBJS = $(SRCS:.c=.o) $(LIBSRCS:.c=.o) $(LIBASM:.S=.o)
include ../lib/common.Makefile
main.o: fix_frame_channel_layout.h
main.o: ../lib/fix_frame_channel_layout.h
install: $(TARGET)
install -m 0755 -D $(TARGET) $(DESTDIR)/usr/bin/$(TARGET)

+ 0
- 20
recording-daemon/.gitignore View File

@ -4,24 +4,4 @@ core
core.*
.ycm_extra_conf.pyc
rtpengine-recording
auxlib.c
loglib.c
rtplib.c
codeclib.c
resample.c
str.c
fix_frame_channel_layout.h
socket.c
streambuf.c
ssllib.c
dtmflib.c
*-test
*-test.c
*.8
mvr2s_x64_avx512.S
mvr2s_x64_avx2.S
mix_in_x64_avx2.S
mix_in_x64_avx512bw.S
mix_in_x64_sse2.S
bufferpool.c
uring.c

+ 0
- 1
recording-daemon/Makefile View File

@ -52,7 +52,6 @@ SRCS= epoll.c garbage.c inotify.c main.c metafile.c stream.c recaux.c packet.c
LIBSRCS= loglib.c auxlib.c rtplib.c codeclib.strhash.c resample.c str.c socket.c streambuf.c ssllib.c \
dtmflib.c bufferpool.c bencode.c
LIBASM= mvr2s_x64_avx2.S mvr2s_x64_avx512.S mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S
OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) $(LIBASM:.S=.o)
MDS= rtpengine-recording.ronn
MANS= $(MDS:.ronn=.8)


+ 0
- 62
t/.gitignore View File

@ -4,89 +4,27 @@ amr-encode-test
amr-decode-test
core
.depend
auxlib.c
codeclib.c
fix_frame_channel_layout.h
loglib.c
resample.c
rtplib.c
str.c
crypto.c
aes-crypt
bencode.c
call.c
call_interfaces.c
cdr.c
codec.c
control_ng.c
control_ng_flags_parser.c
cookie_cache.c
dtls.c
graphite.c
helpers.c
homer.c
ice.c
iptables.c
kernel.c
load.c
media_socket.c
poller.c
recording.c
redis.c
rtcp.c
rtp.c
sdp.c
socket.c
ssrc.c
statistics.c
streambuf.c
stun.c
transcode-test
udp_listener.c
payload-tracker-test
dtmf.c
const_str_hash-test.strhash
tests-preload.so
timerthread.c
media_player.c
dtmflib.c
test-dtmf-detect
test-bitstr
test-const_str_hash.strhash
test-payload-tracker
test-transcode
dtmf_rx_fillin.h
*-test.c
jitter_buffer.c
t38.c
spandsp_recv_fax_pcm
spandsp_recv_fax_t38
spandsp_send_fax_pcm
spandsp_send_fax_t38
spandsp_logging.h
aead-aes-crypt
tcp_listener.c
test-kernel-module
test-resample
mqtt.c
cli.c
janus.c
websocket.c
test-stats
ssllib.c
time-fudge-preload.so
mvr2s_x64_avx2.S
mvr2s_x64_avx512.S
test-mix-buffer
mix_buffer.c
audio_player.c
mix_in_x64_avx2.S
mix_in_x64_avx512bw.S
mix_in_x64_sse2.S
test-amr-decode
test-amr-encode
bufferpool.c
uring.c
aead-decrypt
arena.c
ng_client.c

+ 8
- 11
t/Makefile View File

@ -72,8 +72,7 @@ LDLIBS+= $(LDLIBS_CODEC_CHAIN)
SRCS= test-bitstr.c aes-crypt.c aead-aes-crypt.c test-const_str_hash.strhash.c aead-decrypt.c
LIBSRCS= loglib.c auxlib.c str.c rtplib.c ssllib.c mix_buffer.c bufferpool.c bencode.c
DAEMONSRCS= crypto.c ssrc.c helpers.c rtp.c
HASHSRCS= cli.c
DAEMONSRCS= crypto.c ssrc.c helpers.c rtp.c cli.strhash.c
ifeq ($(with_transcoding),yes)
SRCS+= test-transcode.c test-dtmf-detect.c test-payload-tracker.c test-resample.c test-stats.c
@ -87,16 +86,14 @@ DAEMONSRCS+= control_ng_flags_parser.c codec.c call.c ice.c kernel.c media_socke
dtls.c recording.c statistics.c rtcp.c redis.c iptables.c graphite.c \
cookie_cache.c udp_listener.c homer.c load.c cdr.c dtmf.c timerthread.c \
media_player.c jitter_buffer.c t38.c tcp_listener.c mqtt.c websocket.c \
audio_player.c arena.c ng_client.c
HASHSRCS+= call_interfaces.c control_ng.c sdp.c janus.c
audio_player.c arena.c ng_client.c call_interfaces.strhash.c sdp.strhash.c \
janus.strhash.c control_ng.strhash.c cli.strhash.c
LIBASM= mvr2s_x64_avx2.S mvr2s_x64_avx512.S mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S
endif
ifneq ($(have_liburing),yes)
LIBSRCS+= uring.c
endif
OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) $(DAEMONSRCS:.c=.o) $(HASHSRCS:.c=.strhash.o) $(LIBASM:.S=.o)
COMMONOBJS= str.o auxlib.o rtplib.o loglib.o ssllib.o
include ../lib/common.Makefile
@ -118,7 +115,7 @@ TESTS+= test-amr-decode test-amr-encode
endif
endif
ADD_CLEAN= tests-preload.so time-fudge-preload.so $(TESTS)
ADD_CLEAN= tests-preload.so time-fudge-preload.so $(TESTS) aead-decrypt
ifeq ($(with_transcoding),yes)
all-tests: unit-tests daemon-tests
@ -345,7 +342,7 @@ tests-preload.so: tests-preload.c
time-fudge-preload.so: time-fudge-preload.c
$(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(PRELOAD_LIBS)
spandsp_send_fax_pcm.c: spandsp_logging.h
spandsp_send_fax_t38.c: spandsp_logging.h
spandsp_recv_fax_t38.c: spandsp_logging.h
spandsp_recv_fax_pcm.c: spandsp_logging.h
spandsp_send_fax_pcm.c: ../lib/spandsp_logging.h
spandsp_send_fax_t38.c: ../lib/spandsp_logging.h
spandsp_recv_fax_t38.c: ../lib/spandsp_logging.h
spandsp_recv_fax_pcm.c: ../lib/spandsp_logging.h

+ 3
- 4
utils/build_test_wrapper View File

@ -6,9 +6,8 @@ if test "$MAKE" = ""; then
MAKE=make
fi
echo "Looking for usable alternative for $TARGET"
rm -f "$ROOT"-test "$ROOT"-test.c
ln -s ../lib/"$ROOT"-test.c .
for x in ../lib/"$ROOT"*.h; do
rm -f "$ROOT"-test
for x in "$ROOT"*.h; do
echo "Trying build with $x"
rm -f "$TARGET"
(echo '/******** GENERATED FILE ********/'; cat "$x") > "$TARGET"
@ -16,5 +15,5 @@ for x in ../lib/"$ROOT"*.h; do
echo "Failed build with $x"
rm -f "$TARGET"
done
rm -f "$ROOT"-test "$ROOT"-test.c
rm -f "$ROOT"-test
test -f "$TARGET"

Loading…
Cancel
Save