596f5e0544
Migrated from the webm-tools repository with minor tweaks to fix its build in the new location. Last location/revision: https://chromium.googlesource.com/webm/webm-tools a7e97e8f0a913ddd97444392bb8816f44a4821a1 Change-Id: Icfad43d9fdd37fc413a6a28b57b370c97c7c28df
62 lines
1.8 KiB
Makefile
62 lines
1.8 KiB
Makefile
CXX := g++
|
|
DEFINES := -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
|
|
DEFINES += -D__STDC_LIMIT_MACROS
|
|
INCLUDES := -I.
|
|
CXXFLAGS := -W -Wall -g
|
|
ALL_CXXFLAGS := -MMD -MP $(DEFINES) $(INCLUDES) $(CXXFLAGS)
|
|
LIBWEBMA := libwebm.a
|
|
LIBWEBMSO := libwebm.so
|
|
WEBMOBJS := mkvmuxer/mkvmuxer.o mkvmuxer/mkvmuxerutil.o mkvmuxer/mkvwriter.o
|
|
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
|
|
EXEOBJS := sample.o sample_muxer.o dumpvtt.o vttdemux.o webm_info.o
|
|
INFOOBJS := common/indent.o common/webm_endian.o
|
|
DEPS := $(WEBMOBJS:.o=.d) $(OBJECTS1:.o=.d) $(OBJECTS2:.o=.d)
|
|
DEPS += $(OBJECTS3:.o=.d) $(OBJECTS4:.o=.d) $(OBJSA:.o=.d) $(OBJSSO:.o=.d)
|
|
DEPS += $(VTTOBJS:.o=.d) $(EXEOBJS:.o=.d) $(INFOOBJS:.o=.d)
|
|
EXES := sample_muxer sample dumpvtt vttdemux webm_info
|
|
CLEAN := $(EXEOBJS) $(VTTOBJS) $(WEBMOBJS) $(OBJSA) $(OBJSSO) $(LIBWEBMA)
|
|
CLEAN += $(LIBWEBMSO) $(EXES) $(DEPS) $(INFOOBJS)
|
|
|
|
all: $(EXES)
|
|
|
|
sample: sample.o $(LIBWEBMA)
|
|
$(CXX) $^ -o $@
|
|
|
|
sample_muxer: sample_muxer.o $(VTTOBJS) $(LIBWEBMA)
|
|
$(CXX) $^ -o $@
|
|
|
|
dumpvtt: dumpvtt.o $(VTTOBJS) $(WEBMOBJS)
|
|
$(CXX) $^ -o $@
|
|
|
|
vttdemux: vttdemux.o $(VTTOBJS) $(LIBWEBMA)
|
|
$(CXX) $^ -o $@
|
|
|
|
webm_info: webm_info.o $(INFOOBJS) $(LIBWEBMA)
|
|
$(CXX) $^ -o $@
|
|
|
|
shared: $(LIBWEBMSO)
|
|
|
|
libwebm.a: $(OBJSA)
|
|
$(AR) rcs $@ $^
|
|
|
|
libwebm.so: $(OBJSSO)
|
|
$(CXX) $(ALL_CXXFLAGS) -shared $(OBJSSO) -o $(LIBWEBMSO)
|
|
|
|
%.o: %.cc
|
|
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@
|
|
%_a.o: %.cc
|
|
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@
|
|
%_so.o: %.cc
|
|
$(CXX) -c $(ALL_CXXFLAGS) -fPIC $< -o $@
|
|
|
|
clean:
|
|
$(RM) -f $(CLEAN) Makefile.bak
|
|
|
|
ifneq ($(MAKECMDGOALS), clean)
|
|
-include $(DEPS)
|
|
endif
|