2012-09-21 22:56:11 +02:00
|
|
|
CXX := g++
|
2016-03-17 05:14:26 +01:00
|
|
|
CXXFLAGS := -W -Wall -g -MMD -MP -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
|
2012-09-21 22:56:11 +02:00
|
|
|
LIBWEBMA := libwebm.a
|
|
|
|
LIBWEBMSO := libwebm.so
|
2016-03-17 04:34:30 +01:00
|
|
|
WEBMOBJS := mkvmuxer.o mkvmuxerutil.o mkvwriter.o
|
|
|
|
WEBMOBJS += mkvparser/mkvparser.o mkvparser/mkvreader.o
|
2016-03-07 20:08:14 +01:00
|
|
|
WEBMOBJS += common/file_util.o common/hdr_util.o
|
2012-09-21 22:56:11 +02:00
|
|
|
OBJSA := $(WEBMOBJS:.o=_a.o)
|
|
|
|
OBJSSO := $(WEBMOBJS:.o=_so.o)
|
|
|
|
OBJECTS1 := sample.o
|
2012-10-08 21:50:41 +02:00
|
|
|
OBJECTS2 := sample_muxer.o vttreader.o webvttparser.o sample_muxer_metadata.o
|
2012-09-21 22:56:11 +02:00
|
|
|
OBJECTS3 := dumpvtt.o vttreader.o webvttparser.o
|
2012-08-31 00:16:06 +02:00
|
|
|
OBJECTS4 := vttdemux.o webvttparser.o
|
2012-09-21 22:56:11 +02:00
|
|
|
INCLUDES := -I.
|
2013-08-19 20:03:45 +02:00
|
|
|
DEPS := $(WEBMOBJS:.o=.d) $(OBJECTS1:.o=.d) $(OBJECTS2:.o=.d)
|
2016-03-07 20:09:44 +01:00
|
|
|
DEPS += $(OBJECTS3:.o=.d) $(OBJECTS4:.o=.d) $(OBJSA:.o=.d) $(OBJSSO:.o=.d)
|
2015-03-18 23:31:46 +01:00
|
|
|
EXES := sample_muxer sample dumpvtt vttdemux
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2011-06-21 20:42:55 +02:00
|
|
|
all: $(EXES)
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2012-09-21 22:56:11 +02:00
|
|
|
sample: sample.o $(LIBWEBMA)
|
2011-06-21 20:42:55 +02:00
|
|
|
$(CXX) $^ -o $@
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2015-03-18 23:31:46 +01:00
|
|
|
sample_muxer: $(OBJECTS2) $(LIBWEBMA)
|
2011-06-21 20:42:55 +02:00
|
|
|
$(CXX) $^ -o $@
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2012-08-21 00:41:06 +02:00
|
|
|
dumpvtt: $(OBJECTS3)
|
|
|
|
$(CXX) $^ -o $@
|
|
|
|
|
2012-09-21 22:56:11 +02:00
|
|
|
shared: $(LIBWEBMSO)
|
|
|
|
|
2012-08-31 00:16:06 +02:00
|
|
|
vttdemux: $(OBJECTS4) $(LIBWEBMA)
|
|
|
|
$(CXX) $^ -o $@
|
|
|
|
|
2012-09-21 22:56:11 +02:00
|
|
|
libwebm.a: $(OBJSA)
|
2011-06-21 20:42:55 +02:00
|
|
|
$(AR) rcs $@ $^
|
|
|
|
|
2012-09-21 22:56:11 +02:00
|
|
|
libwebm.so: $(OBJSSO)
|
|
|
|
$(CXX) $(CXXFLAGS) -shared $(OBJSSO) -o $(LIBWEBMSO)
|
|
|
|
|
2011-06-21 20:42:55 +02:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) $(INCLUDES) $< -o $@
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2012-09-21 22:56:11 +02:00
|
|
|
%_a.o: %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) $(INCLUDES) $< -o $@
|
2016-03-07 20:09:44 +01:00
|
|
|
%_a.o: %.cc
|
|
|
|
$(CXX) -c $(CXXFLAGS) $(INCLUDES) $< -o $@
|
2012-09-21 22:56:11 +02:00
|
|
|
|
|
|
|
%_so.o: %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) -fPIC $(INCLUDES) $< -o $@
|
2016-03-07 20:09:44 +01:00
|
|
|
%_so.o: %.cc
|
|
|
|
$(CXX) -c $(CXXFLAGS) -fPIC $(INCLUDES) $< -o $@
|
2012-09-21 22:56:11 +02:00
|
|
|
|
2010-06-02 16:25:06 +02:00
|
|
|
clean:
|
2013-08-19 20:03:45 +02:00
|
|
|
$(RM) -f $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) $(OBJECTS4) $(OBJSA) $(OBJSSO) $(LIBWEBMA) $(LIBWEBMSO) $(EXES) $(DEPS) Makefile.bak
|
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS), clean)
|
|
|
|
-include $(DEPS)
|
|
|
|
endif
|