2016-03-17 23:09:46 +01:00
|
|
|
CXX := g++
|
2016-04-01 04:46:21 +02:00
|
|
|
DEFINES := -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
|
|
|
|
DEFINES += -D__STDC_LIMIT_MACROS
|
2016-03-17 23:09:46 +01:00
|
|
|
INCLUDES := -I.
|
2016-03-23 04:55:33 +01:00
|
|
|
CXXFLAGS := -W -Wall -g
|
|
|
|
ALL_CXXFLAGS := -MMD -MP $(DEFINES) $(INCLUDES) $(CXXFLAGS)
|
2016-03-17 23:09:46 +01:00
|
|
|
LIBWEBMA := libwebm.a
|
|
|
|
LIBWEBMSO := libwebm.so
|
2016-03-18 19:16:35 +01:00
|
|
|
WEBMOBJS := mkvmuxer/mkvmuxer.o mkvmuxer/mkvmuxerutil.o mkvmuxer/mkvwriter.o
|
2016-03-17 23:09:46 +01:00
|
|
|
WEBMOBJS += mkvparser/mkvparser.o mkvparser/mkvreader.o
|
|
|
|
WEBMOBJS += common/file_util.o common/hdr_util.o
|
|
|
|
OBJSA := $(WEBMOBJS:.o=_a.o)
|
|
|
|
OBJSSO := $(WEBMOBJS:.o=_so.o)
|
|
|
|
VTTOBJS := webvtt/vttreader.o webvtt/webvttparser.o sample_muxer_metadata.o
|
2016-08-24 21:21:56 +02:00
|
|
|
EXEOBJS := mkvmuxer_sample.o mkvparser_sample.o dumpvtt.o vttdemux.o
|
|
|
|
EXES := mkvparser_sample mkvmuxer_sample dumpvtt vttdemux
|
2016-03-17 23:09:46 +01:00
|
|
|
DEPS := $(WEBMOBJS:.o=.d) $(OBJECTS1:.o=.d) $(OBJECTS2:.o=.d)
|
|
|
|
DEPS += $(OBJECTS3:.o=.d) $(OBJECTS4:.o=.d) $(OBJSA:.o=.d) $(OBJSSO:.o=.d)
|
2016-04-26 18:51:59 +02:00
|
|
|
DEPS += $(VTTOBJS:.o=.d) $(EXEOBJS:.o=.d)
|
2016-03-17 23:09:46 +01:00
|
|
|
CLEAN := $(EXEOBJS) $(VTTOBJS) $(WEBMOBJS) $(OBJSA) $(OBJSSO) $(LIBWEBMA)
|
2016-04-01 04:46:21 +02:00
|
|
|
CLEAN += $(LIBWEBMSO) $(EXES) $(DEPS) $(INFOOBJS)
|
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
|
|
|
|
2016-08-24 21:21:56 +02:00
|
|
|
mkvparser_sample: mkvparser_sample.o $(LIBWEBMA)
|
2011-06-21 20:42:55 +02:00
|
|
|
$(CXX) $^ -o $@
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2016-08-24 21:21:56 +02:00
|
|
|
mkvmuxer_sample: mkvmuxer_sample.o $(VTTOBJS) $(LIBWEBMA)
|
2011-06-21 20:42:55 +02:00
|
|
|
$(CXX) $^ -o $@
|
2010-06-02 16:25:06 +02:00
|
|
|
|
2016-03-17 22:31:26 +01:00
|
|
|
dumpvtt: dumpvtt.o $(VTTOBJS) $(WEBMOBJS)
|
2012-08-21 00:41:06 +02:00
|
|
|
$(CXX) $^ -o $@
|
|
|
|
|
2016-03-17 22:31:26 +01:00
|
|
|
vttdemux: vttdemux.o $(VTTOBJS) $(LIBWEBMA)
|
2012-08-31 00:16:06 +02:00
|
|
|
$(CXX) $^ -o $@
|
|
|
|
|
2016-03-17 22:31:26 +01:00
|
|
|
shared: $(LIBWEBMSO)
|
|
|
|
|
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)
|
2016-03-23 04:55:33 +01:00
|
|
|
$(CXX) $(ALL_CXXFLAGS) -shared $(OBJSSO) -o $(LIBWEBMSO)
|
2012-09-21 22:56:11 +02:00
|
|
|
|
2016-03-21 19:20:48 +01:00
|
|
|
%.o: %.cc
|
2016-03-23 04:55:33 +01:00
|
|
|
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@
|
2016-03-07 20:09:44 +01:00
|
|
|
%_a.o: %.cc
|
2016-03-23 04:55:33 +01:00
|
|
|
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@
|
2016-03-07 20:09:44 +01:00
|
|
|
%_so.o: %.cc
|
2016-03-23 04:55:33 +01:00
|
|
|
$(CXX) -c $(ALL_CXXFLAGS) -fPIC $< -o $@
|
2012-09-21 22:56:11 +02:00
|
|
|
|
2010-06-02 16:25:06 +02:00
|
|
|
clean:
|
2016-03-17 22:31:26 +01:00
|
|
|
$(RM) -f $(CLEAN) Makefile.bak
|
2013-08-19 20:03:45 +02:00
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS), clean)
|
|
|
|
-include $(DEPS)
|
|
|
|
endif
|