shithub: openh264

Download patch

ref: 4afa4fc7a86ce17bad52ae9df1400db029729b0d
parent: 59466d0986acd653dd042ff87583cbce171f3167
parent: 488fb7bb20539a756cace24f71adfd017b248b85
author: Ethan Hugg <ethanhugg@gmail.com>
date: Wed Jan 8 04:35:21 EST 2014

Merge pull request #116 from mstorsjo/make-deps

Add proper dependencies for the command line binaries

--- a/Makefile
+++ b/Makefile
@@ -64,11 +64,14 @@
 
 H264DEC_INCLUDES = $(DECODER_INCLUDES) -Icodec/console/dec/inc
 H264DEC_LDFLAGS = -L. -ldecoder -lcommon
+H264DEC_DEPS = $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
 
 H264ENC_INCLUDES = $(ENCODER_INCLUDES) -Icodec/console/enc/inc
 H264ENC_LDFLAGS = -L. -lencoder -lprocessing -lcommon
+H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
 
 CODEC_UNITTEST_LDFLAGS = -L. -lgtest -ldecoder -lcommon
+CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
 
 .PHONY: test
 
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -98,7 +98,7 @@
     f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library);
 
 if args.binary is not None:
-    f.write("%s: $(%s_OBJS) $(LIBS) $(%s_LIBS)\n"%(args.binary, PREFIX, PREFIX))
+    f.write("%s: $(%s_OBJS) $(LIBS) $(%s_LIBS) $(%s_DEPS)\n"%(args.binary, PREFIX, PREFIX, PREFIX))
     f.write("\t$(CXX) -o $@  $(%s_OBJS) $(%s_LDFLAGS) $(%s_LIBS) $(LDFLAGS) $(LIBS)\n\n"%(PREFIX, PREFIX, PREFIX))
     f.write("binaries: %s\n"%args.binary);
     f.write("BINARIES += %s\n"%args.binary);
--- a/codec/console/dec/targets.mk
+++ b/codec/console/dec/targets.mk
@@ -22,7 +22,7 @@
 $(H264DEC_SRCDIR)/./src/read_config.o: $(H264DEC_SRCDIR)/./src/read_config.cpp
 	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c -o $(H264DEC_SRCDIR)/./src/read_config.o $(H264DEC_SRCDIR)/./src/read_config.cpp
 
-h264dec: $(H264DEC_OBJS) $(LIBS) $(H264DEC_LIBS)
+h264dec: $(H264DEC_OBJS) $(LIBS) $(H264DEC_LIBS) $(H264DEC_DEPS)
 	$(CXX) -o $@  $(H264DEC_OBJS) $(H264DEC_LDFLAGS) $(H264DEC_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: h264dec
--- a/codec/console/enc/targets.mk
+++ b/codec/console/enc/targets.mk
@@ -18,7 +18,7 @@
 $(H264ENC_SRCDIR)/./src/welsenc.o: $(H264ENC_SRCDIR)/./src/welsenc.cpp
 	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c -o $(H264ENC_SRCDIR)/./src/welsenc.o $(H264ENC_SRCDIR)/./src/welsenc.cpp
 
-h264enc: $(H264ENC_OBJS) $(LIBS) $(H264ENC_LIBS)
+h264enc: $(H264ENC_OBJS) $(LIBS) $(H264ENC_LIBS) $(H264ENC_DEPS)
 	$(CXX) -o $@  $(H264ENC_OBJS) $(H264ENC_LDFLAGS) $(H264ENC_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: h264enc
--- a/test/targets.mk
+++ b/test/targets.mk
@@ -14,7 +14,7 @@
 $(CODEC_UNITTEST_SRCDIR)/./simple_test.o: $(CODEC_UNITTEST_SRCDIR)/./simple_test.cpp
 	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c -o $(CODEC_UNITTEST_SRCDIR)/./simple_test.o $(CODEC_UNITTEST_SRCDIR)/./simple_test.cpp
 
-codec_unittest: $(CODEC_UNITTEST_OBJS) $(LIBS) $(CODEC_UNITTEST_LIBS)
+codec_unittest: $(CODEC_UNITTEST_OBJS) $(LIBS) $(CODEC_UNITTEST_LIBS) $(CODEC_UNITTEST_DEPS)
 	$(CXX) -o $@  $(CODEC_UNITTEST_OBJS) $(CODEC_UNITTEST_LDFLAGS) $(CODEC_UNITTEST_LIBS) $(LDFLAGS) $(LIBS)
 
 binaries: codec_unittest