### PART 1 # SYSTEM #######################################################################
 ###########################################################################################
 
-# choose one of the following platforms:
-# PLATFORM=nevis
-# PLATFORM=apollo
-# PLATFORM=kronos
-PLATFORM=nevis
-
-# choose one of the following crosstool versions:
-# CROSSTOOL_VERSION=1.16.0
-# CROSSTOOL_VERSION=1.19.0
-# CROSSTOOL_VERSION=1.20.0
-CROSSTOOL_VERSION=1.20.0
+# set BOXMODEL to specify the STB type you want to build for
+# possible values are tank, trinity, link, zee2, zee and neo
+# please select also link for trinity duo
+# and neo for neo-twin, neo2, hd1 and bse as well
+# if you don't specify a value or something is misspelled
+# the default value neo will be used
+#
+BOXMODEL = neo
 
 # if you want to use your precompiled toolchain, define CROSS_DIR:
 # this will skip the building of our own compiler/glibc combination!
 # BUILD=x86_64-unknown-linux-gnu
 
 # choose one of the following neutrino-hd-port versions:
-# NEUTRINO_HD_PORT=neutrino-hd-single-old (coolstream neutrino-experimental port)
-# NEUTRINO_HD_PORT=neutrino-hd-single (coolstream single port)
 # NEUTRINO_HD_PORT=neutrino-hd-master (coolstream master port)
-# NEUTRINO_HD_PORT=neutrino-hd-pucc (coolstream pu/cc port)
-# NEUTRINO_HD_PORT=neutrino-hd-next (coolstream next port)
-# NEUTRINO_HD_PORT=neutrino-hd-next-cc (coolstream next-cc port)
-# NEUTRINO_HD_PORT=neutrino-hd-cst-next (coolstream cst-next port)
-NEUTRINO_HD_PORT=neutrino-hd-cst-next
+# NEUTRINO_HD_PORT=neutrino-hd-pumoviebouquets (coolstream pu/moviebouquets port)
+NEUTRINO_HD_PORT=neutrino-hd-master
 
 # choose one of the following coolstream kernel versions:
-# CST_KERNEL_VERSION=2.6.26.8
-# CST_KERNEL_VERSION=2.6.34.13
-# CST_KERNEL_VERSION=2.6.35.14
-# CST_KERNEL_VERSION=2.6.39.4
+# Nevis
 CST_KERNEL_VERSION=2.6.34.13
+# Apollo / Kronos
+# CST_KERNEL_VERSION=3.10.70
+# CST_KERNEL_VERSION=3.10.93
+
+
+# !ADVANCED!
+# if you know what you're doing you can set a specific driver directoy,
+# kernel version and branch (but you have to make sure that all entries matches)
+#
+# DRIVER_DIR=apollo-3.x
+# KBRANCH=cst_3.10
+# KBRANCH=cst_3.10.93
 
 # choose one of the following coolstream driver versions:
 # CST_DRIVER_VERSION=master
 
 SVN   ?= svn
 SVNCO ?= $(SVN) co http://tuxcode.svn.sourceforge.net/svnroot/tuxcode
 
-CSGIT ?= git://git.coolstreamtech.de
+#CSGIT ?= git://git.coolstreamtech.de
+CSGIT ?= git://github.com/tuxbox-neutrino
 
 NTGIT ?= git://novatux.git.sourceforge.net/gitroot/novatux
 
+# 28 Repositories
+REPO_BOOTLOADER_UBOOT = bootloader-uboot-cst.git
+REPO_DRIVERS_BIN_CST = drivers-bin-cst.git
+REPO_DRIVERS_THIRD_PARTY_CST = drivers-third-party-cst.git
+REPO_GUI_NEUTRINO = gui-neutrino.git
+REPO_GUI_YWEB = gui-yweb.git
+REPO_LIBRARY_DVBSI = library-dvbsi.git
+REPO_LIBRARY_FFMPEG_CST = library-ffmpeg-cst.git
+REPO_LIBRARY_OPENTHREADS = library-openthreads.git # (Enthält Submodules)
+REPO_LIBRARY_OPENTHREADS_INCLUDE = library-openthreads-include.git
+REPO_LIBRARY_OPENTHREADS_SRC = library-openthreads-src.git
+REPO_KERNEL_CST = linux-kernel-cst.git
+REPO_PLUGIN_BLOCKADS = plugin-blockads.git
+REPO_PLUGIN_COOLITSCLIMAX = plugin-cooliTSclimax.git
+REPO_PLUGIN_GETRC = plugin-getrc.git
+REPO_PLUGIN_INPUT = plugin-input.git
+REPO_PLUGIN_LBREAKOUT = plugin-lbreakout.git
+REPO_PLUGIN_LINKS = plugin-links.git
+REPO_PLUGIN_LOGOMASK = plugin-logomask.git
+REPO_PLUGIN_LOGOVIEW = plugin-logoview.git
+REPO_PLUGIN_LTRIS = plugin-ltris.git
+REPO_PLUGIN_MSGBOX = plugin-msgbox.git
+REPO_PLUGIN_SCRIPS_LUA = plugin-scripts-lua.git
+REPO_PLUGIN_SHELLEXEC = plugin-shellexec.git
+REPO_PLUGIN_TUXCAL = plugin-tuxcal.git
+REPO_PLUGIN_TUXCOM = plugin-tuxcom.git
+REPO_PLUGIN_TUXMAIL = plugin-tuxmail.git
+REPO_PLUGIN_TUXWETTER = plugin-tuxwetter.git
+REPO_PLUGINS = plugins.git # (Enthält Submodules)
+
 # some usefull folders
 GIT_BOOTLOADER         = $(SOURCE_DIR)/git/BOOTLOADER
 GIT_DRIVERS_THIRDPARTY = $(SOURCE_DIR)/git/DRIVERS_THIRDPARTY
 
 $(SOURCE_DIR)/neutrino-hd:
        mkdir -p $(SOURCE_DIR)
        cd $(SOURCE_DIR) && \
-               if [ $(NEUTRINO_HD_PORT) = "neutrino-hd-single-old" ]; then \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-single-old/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-single-old && \
-                               git pull origin neutrino-experimental && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-single-old neutrino-hd; \
-                       else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-single-old; \
-                               cd $(SOURCE_DIR)/neutrino-hd-single-old && \
-                               git checkout --track -b neutrino-experimental origin/neutrino-experimental && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-single-old neutrino-hd; \
-                       fi; \
-               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-master" ]; then \
+               if [ $(NEUTRINO_HD_PORT) = "neutrino-hd-master" ]; then \
                        if [ -d $(SOURCE_DIR)/neutrino-hd-master/ ]; then \
                                cd $(SOURCE_DIR)/neutrino-hd-master && \
                                git pull origin master && \
                                cd $(SOURCE_DIR) && \
                                ln -sf neutrino-hd-master neutrino-hd; \
                        else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-master; \
+                               git clone $(CSGIT)/$(REPO_GUI_NEUTRINO) neutrino-hd-master; \
                                cd $(SOURCE_DIR)/neutrino-hd-master && \
                                git checkout --track -b master origin/master && \
                                rm -rf $(SOURCE_DIR)/neutrino-hd; \
                                cd $(SOURCE_DIR) && \
                                ln -sf neutrino-hd-master neutrino-hd; \
                        fi; \
-               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-pucc" ]; then \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-pucc/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-pucc && \
-                               git pull origin pu/cc && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-pucc neutrino-hd; \
-                       else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-pucc; \
-                               cd $(SOURCE_DIR)/neutrino-hd-pucc && \
-                               git checkout --track -b pu/cc origin/pu/cc && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-pucc neutrino-hd; \
-                       fi; \
-               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-next-cc" ]; then \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-next-cc/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-next-cc && \
-                               git pull origin next-cc && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-next-cc neutrino-hd; \
-                       else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-next-cc; \
-                               cd $(SOURCE_DIR)/neutrino-hd-next-cc && \
-                               git checkout --track -b next-cc origin/next-cc && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-next-cc neutrino-hd; \
-                       fi; \
-               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-next" ]; then \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-next/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-next && \
-                               git pull origin next && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-next neutrino-hd; \
-                       else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-next; \
-                               cd $(SOURCE_DIR)/neutrino-hd-next && \
-                               git checkout --track -b next origin/next && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-next neutrino-hd; \
-                       fi; \
-               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-cst-next" ]; then \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-cst-next/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-cst-next && \
-                               git pull origin cst-next && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-cst-next neutrino-hd; \
-                       else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-cst-next; \
-                               cd $(SOURCE_DIR)/neutrino-hd-cst-next && \
-                               git checkout --track -b cst-next origin/cst-next && \
-                               rm -rf $(SOURCE_DIR)/neutrino-hd; \
-                               cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-cst-next neutrino-hd; \
-                       fi; \
-               else \
-                       if [ -d $(SOURCE_DIR)/neutrino-hd-single/ ]; then \
-                               cd $(SOURCE_DIR)/neutrino-hd-single && \
-                               git pull origin single && \
+               elif [ $(NEUTRINO_HD_PORT) = "neutrino-hd-pumoviebouquets" ]; then \
+                       if [ -d $(SOURCE_DIR)/neutrino-hd-pumoviebouquets/ ]; then \
+                               cd $(SOURCE_DIR)/neutrino-hd-pumoviebouquets && \
+                               git pull origin pu/moviebouquets && \
                                rm -rf $(SOURCE_DIR)/neutrino-hd; \
                                cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-single neutrino-hd; \
+                               ln -sf neutrino-hd-pumoviebouquets neutrino-hd; \
                        else \
-                               git clone $(CSGIT)/cst-public-gui-neutrino.git/ neutrino-hd-single; \
-                               cd $(SOURCE_DIR)/neutrino-hd-single && \
-                               git checkout --track -b single origin/single && \
+                               git clone $(CSGIT)/$(REPO_GUI_NEUTRINO) neutrino-hd-pumoviebouquets; \
+                               cd $(SOURCE_DIR)/neutrino-hd-pumoviebouquets && \
+                               git checkout --track -b pu/moviebouquets origin/pu/moviebouquets && \
                                rm -rf $(SOURCE_DIR)/neutrino-hd; \
                                cd $(SOURCE_DIR) && \
-                               ln -sf neutrino-hd-single neutrino-hd; \
+                               ln -sf neutrino-hd-pumoviebouquets neutrino-hd; \
                        fi; \
                fi
 
                        git pull origin coolstream_hdx; \
                else \
                        cd $(SOURCE_DIR)/git; \
-                       git clone $(CSGIT)/cst-public-bootloader-uboot.git/ BOOTLOADER; \
+                       git clone $(CSGIT)/$(REPO_BOOTLOADER_UBOOT) BOOTLOADER; \
                        cd $(GIT_BOOTLOADER) && \
                        git checkout coolstream_hdx; \
                fi
                        git pull origin master; \
                else \
                        cd $(SOURCE_DIR)/git; \
-                       git clone $(CSGIT)/cst-public-drivers-third-party.git/ DRIVERS_THIRDPARTY; \
+                       git clone $(CSGIT)/$(REPO_DRIVERS_THIRD_PARTY_CST) DRIVERS_THIRDPARTY; \
                        cd $(GIT_DRIVERS_THIRDPARTY) && \
                        git checkout master; \
                fi
                        git pull origin $(CST_DRIVER_VERSION); \
                else \
                        cd $(SOURCE_DIR)/git; \
-                       git clone $(CSGIT)/cst-public-drivers.git/ DRIVERS; \
+                       git clone $(CSGIT)/$(REPO_DRIVERS_BIN_CST) DRIVERS; \
                        cd $(GIT_DRIVERS) && \
                        git checkout $(CST_DRIVER_VERSION); \
                fi
                        git checkout $(CST_FFMPEG_VERSION); \
                        git pull origin $(CST_FFMPEG_VERSION); \
                else \
-                       git clone $(CSGIT)/cst-public-libraries-ffmpeg.git/ ffmpeg/$(CST_FFMPEG_VERSION); \
+                       git clone $(CSGIT)/$(REPO_LIBRARY_FFMPEG_CST) ffmpeg/$(CST_FFMPEG_VERSION); \
                        cd $(GIT_LIBRARIES)/ffmpeg/$(CST_FFMPEG_VERSION) && \
                        git checkout $(CST_FFMPEG_VERSION); \
                fi
                        cd $(GIT_LIBRARIES)/OpenThreads/include && \
                        git pull origin master; \
                else \
-                       git clone $(CSGIT)/cst-public-libraries-openthreads.git/ OpenThreads; \
+                       git clone $(CSGIT)/$(REPO_LIBRARY_OPENTHREADS) OpenThreads; \
                        cd $(GIT_LIBRARIES)/OpenThreads; \
-                       git clone $(CSGIT)/cst-public-libraries-openthreads-src.git src/; \
-                       git clone $(CSGIT)/cst-public-libraries-openthreads-include.git include/; \
+                       git clone $(CSGIT)/$(REPO_LIBRARY_OPENTHREADS_SRC) src/; \
+                       git clone $(CSGIT)/$(REPO_LIBRARY_OPENTHREADS_INCLUDE) include/; \
                fi
 
 $(GIT_KERNEL):
                        cd $(GIT_KERNEL)/linux-$(KBRANCH) && \
                        git pull origin $(KBRANCH); \
                else \
-                       git clone -b $(KBRANCH) $(CSGIT)/cst-public-linux-kernel.git/ linux-$(KBRANCH); \
+                       git clone -b $(KBRANCH) $(CSGIT)/$(REPO_KERNEL_CST) linux-$(KBRANCH); \
                        cd $(GIT_KERNEL)/linux-$(KBRANCH) && \
                        git checkout $(KBRANCH); \
                fi && \
                        git pull origin master; \
                        git submodule update; \
                else \
-                       git clone --recursive $(CSGIT)/cst-public-plugins.git/ PLUGINS; \
+                       git clone --recursive $(CSGIT)/$(REPO_PLUGINS) PLUGINS; \
                fi
 
 # hack to make sure they are always copied