diff options
-rw-r--r-- | Makefile | 43 | ||||
-rw-r--r-- | mcast/client/Makefile | 15 | ||||
-rw-r--r-- | mcast/tool/Makefile | 7 |
3 files changed, 29 insertions, 36 deletions
@@ -45,24 +45,19 @@ SOFILE = libvdr-$(PLUGIN).so ### Includes and Defines (add further entries here): -ifdef RBMINI - XML_INC := -I/usr/arm-linux-gnueabi/include/libxml2 - XML_LIB := -lxml2 -else - XML_INC := `xml2-config --cflags` - XML_LIB := `xml2-config --libs` -endif +.PHONY: i18n all clean +XML_INC ?= $(shell xml2-config --cflags) +XML_LIB ?= $(shell xml2-config --libs) ifdef MCLI_SHARED - LIBS = -lmcli -Lmcast/client $(XML_LIB) + LIBS = -Lmcast/client -lmcli $(XML_LIB) else LIBS = mcast/client/libmcli.a $(XML_LIB) endif INCLUDES += -I$(VDRDIR)/include -I. $(XML_INC) - DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' # -DDEVICE_ATTRIBUTES @@ -72,15 +67,21 @@ OBJS = $(PLUGIN).o cam_menu.o device.o filter.o packetbuffer.o ### The main target: -all: $(SOFILE) +all: lib plugin tools i18n -plug: libmcli.so libvdr-$(PLUGIN).so -all: libmcli.so libvdr-$(PLUGIN).so i18n +plugin: i18n + $(MAKE) XML_INC="$(XML_INC)" XML_LIB="$(XML_LIB)" libvdr-$(PLUGIN).so -libmcli.a libmcli.so: - $(MAKE) -C mcast/client/ +tools: lib + $(MAKE) XML_INC="$(XML_INC)" XML_LIB="$(XML_LIB)" -C mcast/client/ mcli + $(MAKE) XML_INC="$(XML_INC)" XML_LIB="$(XML_LIB)" -C mcast/tool/ all +lib: + $(MAKE) XML_INC="$(XML_INC)" XML_LIB="$(XML_LIB)" libmcli.so + +libmcli.a libmcli.so: + $(MAKE) XML_INC="$(XML_INC)" XML_LIB="$(XML_LIB)" -C mcast/client/ libmcli ### Implicit rules: @@ -118,21 +119,17 @@ $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo @mkdir -p $(dir $@) cp $< $@ -.PHONY: i18n i18n: $(I18Nmsgs) $(I18Npot) i18n-dist: $(I18Nmsgs) ### Targets: -$(SOFILE): $(OBJS) - $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ - -libvdr-$(PLUGIN).so: $(OBJS) +$(SOFILE): $(OBJS) libmcli.a ifeq ($(APPLE_DARWIN), 1) $(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(APIVERSION) else - $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) endif @@ -150,4 +147,8 @@ dist: clean @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ po/*.mo po/*.pot + $(MAKE) -C mcast/client/ clean + $(MAKE) -C mcast/netcv2dvbip/ clean + $(MAKE) -C mcast/tool/ clean + diff --git a/mcast/client/Makefile b/mcast/client/Makefile index 1ea0844..0c79969 100644 --- a/mcast/client/Makefile +++ b/mcast/client/Makefile @@ -10,7 +10,7 @@ ifdef RBMINI ARMEL=1 endif -ARCH= $(shell $(CC) -dumpmachine) +ARCH ?= $(shell $(CC) -dumpmachine) APPLE_DARWIN = $(shell echo $(ARCH) | grep -q 'apple-darwin' && echo "1" || echo "0") CYGWIN = $(shell echo $(ARCH) | grep -q 'cygwin' && echo "1" || echo "0") MIPSEL = $(shell echo $(ARCH) | grep -q 'mipsel' && echo "1" || echo "0") @@ -32,17 +32,11 @@ VDRDIR=../../../../.. -include $(VDRDIR)/Make.config ifdef ARMEL - XML_INC := -I/usr/arm-linux-gnueabi/include/libxml2 - XML_LIB := -lxml2 CROSS = arm-linux-gnueabi- else ifeq ($(MIPSEL),1) DEFS:=$(DEFS) -DMIPSEL -XML_INC:=-I../../libxml2/include -XML_LIB:=-L../../libxml2/lib else -XML_INC:=`xml2-config --cflags` -XML_LIB:=`xml2-config --libs` LIBRARY_PATH=/usr/lib endif endif @@ -106,7 +100,10 @@ MCLI_SOBJS := $(MCLI_SOBJS) dvblo_handler.o input.o endif endif -all: lib$(MCLI) +all: + $(MAKE) lib$(MCLI) + $(MAKE) $(MCLI)-shared + $(MAKE) mcli static: $(MCLI)-static @@ -119,7 +116,7 @@ $(DEPFILE): Makefile -include $(DEPFILE) -$(MCLI): $(MCLI_OBJS) $(MCLI_SOBJS) +$(MCLI): $(MCLI_OBJS) $(MCLI_SOBJS) libmcli.so $(CC) $(LDFLAGS) -o $@ $(MCLI_OBJS) $(MCLI_SOBJS) $(LDLIBS) ifndef DEBUG ifndef WIN32 diff --git a/mcast/tool/Makefile b/mcast/tool/Makefile index 1c1d446..77b386c 100644 --- a/mcast/tool/Makefile +++ b/mcast/tool/Makefile @@ -26,12 +26,7 @@ endif VDRDIR=../../../../.. -include $(VDRDIR)/Make.config -ifdef ARMEL - XML_INC := -I/usr/arm-linux-gnueabi/include/libxml2 - XML_LIB := -lxml2 -else - XML_INC := `xml2-config --cflags` - XML_LIB := `xml2-config --libs` +ifndef ARMEL LIBRARY_PATH = /usr/lib endif |