1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
$(shell GITVERSION=`git rev-parse --short HEAD 2> /dev/null`; sed "s/\";/ ($$GITVERSION)\";/" ../version.dist > version.h )
# some data from environment
HOMEDRIVE = $(shell env | grep HOMEDRIVE | cut -d'=' -f2)
HOMEPATH = $(shell env | grep HOMEPATH | cut -d'=' -f2)
HOME = $(HOMEDRIVE)$(HOMEPATH)
APPDATA = $(shell env | grep ^APPDATA | cut -d'=' -f2)
MARKAD_DIR= $(APPDATA)\vdr-plugin-markad
# for installation:
BINDIR = $(MARKAD_DIR)
MANDIR = $(MARKAD_DIR)\man
LOCDIR = $(MARKAD_DIR)\locale
CXX = g++
CXXFLAGS = -g -O3 -Wall -Woverloaded-virtual -Wno-parentheses -Wfatal-errors
CXXFLAGS+= -funroll-loops
PKG-CONFIG ?= pkg-config
STRIP ?= strip
### Includes and Defines (add further entries here):
PKG-LIBS += libavcodec libavutil libavformat libavfilter libswresample
PKG-INCLUDES += libavcodec libavutil libavformat libavfilter libswresample
DEFINES += -D_GNU_SOURCE
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
LIBS += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS)) -pthread
LIBS += -lintl
LIBS += -lws2_32
### The object files (add further files here):
WIN32_SRC:=$(wildcard win32/*.cpp)
OBJS = $(WIN32_SRC:.cpp=.o)
OBJS+= evaluate.o
OBJS+= debug.o
OBJS+= index.o
OBJS+= logo.o
OBJS+= encoder.o
OBJS+= decoder.o
OBJS+= audio.o
OBJS+= video.o
OBJS+= marks.o
OBJS+= markad-standalone.o
OBJS+= criteria.o
OBJS+= vps.o
OBJS+= tools.o
OBJS+= overlap.o
OBJS+= sobel.o
OBJS+= test.o
WIN32_SRC:=$(wildcard win32/*.cpp)
### The main target:
all: report markad i18n
### Dependencies:
MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@
-include $(DEPFILE)
### Internationalization (I18N):
PODIR = po
I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/markad.mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Npot = $(PODIR)/markad.pot
%.mo: %.po
msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.cpp *.h)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^
%.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
@touch $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/markad.mo: $(PODIR)/%.mo
install -D -m644 $< $@
.PHONY: i18n
i18n: $(I18Npot)
### Targets:
markad: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
### Implicit rules:
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
report:
$(info MARKAD_DIR: ${MARKAD_DIR})
install-doc:
@mkdir -p $(DESTDIR)$(MANDIR)/man1
@gzip -c markad.1 > $(DESTDIR)$(MANDIR)/man1/markad.1.gz
install: install-doc markad $(I18Nmsgs)
@mkdir -p $(DESTDIR)$(BINDIR)
install -D markad $(DESTDIR)$(BINDIR)/markad
@mkdir -p $(DESTDIR)/var/lib/markad
install -D logos/* $(DESTDIR)/var/lib/markad
@echo markad installed
clean:
rm -f *.o
rm -f win32/*.o
rm -f $(DEPFILE)
rm -f markad
rm -f $(PODIR)/*.mo
rm -f $(PODIR)/*.pot
|