diff --git a/daemon/.gitignore b/daemon/.gitignore index 231c2c500..fc91c5159 100644 --- a/daemon/.gitignore +++ b/daemon/.gitignore @@ -16,3 +16,4 @@ socket.c streambuf.c ssllib.c dtmflib.c +*-test diff --git a/lib/common.Makefile b/lib/common.Makefile index b99a99976..86c9707ff 100644 --- a/lib/common.Makefile +++ b/lib/common.Makefile @@ -11,9 +11,11 @@ debug: dep: .depend +BUILD_TEST_ALTS = fix_frame_channel_layout.h + clean: rm -f $(OBJS) $(TARGET) $(LIBSRCS) $(DAEMONSRCS) $(MANS) $(ADD_CLEAN) .depend core core.* - rm -f fix_frame_channel_layout.h fix_frame_channel_layout-test.[co] *.strhash.c $(HASHSRCS) + rm -f $(BUILD_TEST_ALTS) $(BUILD_TEST_ALTS:.h=-test{.c,}) *.strhash.c $(HASHSRCS) .depend: $(SRCS) $(LIBSRCS) $(DAEMONSRCS) Makefile $(CC) $(CFLAGS) -M $(SRCS) $(LIBSRCS) $(DAEMONSRCS) | sed -e 's/:/ .depend:/' > .depend @@ -44,20 +46,20 @@ resample.c: fix_frame_channel_layout.h %.strhash.c: %.c ../utils/const_str_hash ../utils/const_str_hash < $< > $@ -fix_frame_channel_layout.h: ../lib/fix_frame_channel_layout-* +$(BUILD_TEST_ALTS): ../lib/$(@:.h=-*) echo "Looking for usable alternative for $@"; \ - rm -f fix_frame_channel_layout-test.[co]; \ - ln -s ../lib/fix_frame_channel_layout-test.c; \ - for x in ../lib/fix_frame_channel_layout-*.h; do \ + rm -f $(@:.h=-test{.c,}); \ + ln -s ../lib/$(@:.h=-test.c); \ + for x in ../lib/$(@:.h=-*.h); do \ echo "Trying build with $$x"; \ rm -f "$@"; \ echo '/******** GENERATED FILE ********/' > "$@"; \ cat "$$x" >> "$@"; \ - $(MAKE) fix_frame_channel_layout-test.o && break; \ + $(MAKE) $(@:.h=-test) && break; \ echo "Failed build with $$x"; \ rm -f "$@"; \ done; \ - rm -f fix_frame_channel_layout-test.[co]; \ + rm -f $(@:.h=-test{.c,}); \ test -f "$@" .PHONY: all debug dep clean install diff --git a/lib/fix_frame_channel_layout-test.c b/lib/fix_frame_channel_layout-test.c index 5cf538498..4c61be9ef 100644 --- a/lib/fix_frame_channel_layout-test.c +++ b/lib/fix_frame_channel_layout-test.c @@ -1,5 +1,6 @@ #include "fix_frame_channel_layout.h" -void test(void) { +int main(void) { AVFrame *f = NULL; fix_frame_channel_layout(f); + return 0; } diff --git a/recording-daemon/.gitignore b/recording-daemon/.gitignore index 37fdfb5af..81724b20c 100644 --- a/recording-daemon/.gitignore +++ b/recording-daemon/.gitignore @@ -15,3 +15,4 @@ socket.c streambuf.c ssllib.c dtmflib.c +*-test diff --git a/t/.gitignore b/t/.gitignore index 0adddf88d..bf2a12647 100644 --- a/t/.gitignore +++ b/t/.gitignore @@ -50,3 +50,4 @@ timerthread.c media_player.c dtmflib.c test-dtmf-detect +*-test