3cacaf85f1
This makes sure that e.g. "make clean" actually removes the built exe files, and avoids relinking the exe files each time make is run when cross compiling from linux to windows. (Make on windows seems to have an exception that knows to skip rebuilding the 'h264enc' target if 'h264enc' doesn't exist but 'h264enc.exe' does, but this exception doesn't work on normal unix make.)
18 lines
775 B
Makefile
18 lines
775 B
Makefile
CODEC_UNITTEST_PREFIX=CODEC_UNITTEST
|
|
CODEC_UNITTEST_SRCDIR=test
|
|
CODEC_UNITTEST_CPP_SRCS=\
|
|
$(CODEC_UNITTEST_SRCDIR)/./decoder_test.cpp\
|
|
$(CODEC_UNITTEST_SRCDIR)/./encoder_test.cpp\
|
|
$(CODEC_UNITTEST_SRCDIR)/./simple_test.cpp\
|
|
|
|
CODEC_UNITTEST_OBJS += $(CODEC_UNITTEST_CPP_SRCS:.cpp=.o)
|
|
OBJS += $(CODEC_UNITTEST_OBJS)
|
|
$(CODEC_UNITTEST_SRCDIR)/%.o: $(CODEC_UNITTEST_SRCDIR)/%.cpp
|
|
$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CODEC_UNITTEST_CFLAGS) $(CODEC_UNITTEST_INCLUDES) -c $(CXX_O) $<
|
|
|
|
codec_unittest$(EXEEXT): $(CODEC_UNITTEST_OBJS) $(LIBS) $(CODEC_UNITTEST_LIBS) $(CODEC_UNITTEST_DEPS)
|
|
$(CXX) $(CXX_LINK_O) $(CODEC_UNITTEST_OBJS) $(CODEC_UNITTEST_LDFLAGS) $(CODEC_UNITTEST_LIBS) $(LDFLAGS) $(LIBS)
|
|
|
|
binaries: codec_unittest$(EXEEXT)
|
|
BINARIES += codec_unittest$(EXEEXT)
|