satip-axe/Makefile

769 lines
24 KiB
Makefile
Raw Normal View History

BUILD=15
VERSION=$(shell date +%Y%m%d%H%M)-$(BUILD)
CPUS=4
CURDIR=$(shell pwd)
2015-03-28 09:36:07 +01:00
STLINUX=/opt/STM/STLinux-2.4
TOOLPATH=$(STLINUX)/host/bin
TOOLCHAIN=$(STLINUX)/devkit/sh4
TOOLCHAIN_KERNEL=$(CURDIR)/toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4
2015-04-03 13:20:23 +02:00
HOST_ARCH=$(shell uname -m)
EXTRA_AXE_MODULES_DIR=firmware/initramfs/root/modules_idl4k_7108_ST40HOST_LINUX_32BITS
2016-02-23 21:17:36 +01:00
EXTRA_AXE_MODULES=axe_dmx.ko axe_dmxts.ko axe_fp.ko axe_i2c.ko \
stapi_core_stripped.ko stapi_ioctl_stripped.ko stsys_ioctl.ko
2015-08-03 16:57:27 +02:00
EXTRA_AXE_LIBS_DIR=firmware/initramfs/usr/local/lib
EXTRA_AXE_LIBS=libboost_date_time.so libboost_date_time.so.1.53.0 \
libboost_thread.so libboost_thread.so.1.53.0 \
libboost_filesystem.so libboost_filesystem.so.1.53.0 \
libboost_serialization.so libboost_serialization.so.1.53.0 \
libboost_system.so libboost_system.so.1.53.0
ORIG_FILES=main_axe.out
KMODULES = drivers/usb/serial/cp210x.ko \
drivers/usb/serial/pl2303.ko \
drivers/usb/serial/spcp8x5.ko \
drivers/usb/serial/io_ti.ko \
drivers/usb/serial/ti_usb_3410_5052.ko \
drivers/usb/serial/io_edgeport.ko \
drivers/usb/serial/ftdi_sio.ko \
drivers/usb/serial/oti6858.ko
MINISATIP_COMMIT=54df9348e7bd7e6075f54f1b93ec4ad36429abe0
2016-07-04 22:54:49 +02:00
MINISATIP5_COMMIT=67e88c2d743d6df9c4a96aad772414169f61b764
MINISATIP7_COMMIT=d22ba0dfe3c706c3ab6ad86486d8a9e913080f7e
MINISATIP8_COMMIT=8e2362435cc8c5e0babc3e7ca67570c7f7dd03c5
2017-05-03 17:04:12 +02:00
BUSYBOX=busybox-1.26.2
DROPBEAR=dropbear-2017.75
DROPBEAR_SBIN_FILES=dropbear
DROPBEAR_BIN_FILES=dbclient dropbearconvert dropbearkey scp
ETHTOOL=ethtool-3.18
MTD_UTILS_COMMIT=v1.5.1
2015-04-21 14:54:49 +02:00
LIBTIRPC_VERSION=0.2.5
LIBTIRPC=libtirpc-$(LIBTIRPC_VERSION)
2017-05-03 17:04:12 +02:00
RPCBIND_VERSION=0.2.3
2015-04-21 14:54:49 +02:00
RPCBIND=rpcbind-$(RPCBIND_VERSION)
RPCBIND_SBIN_FILES=rpcbind rpcinfo
2017-05-03 17:04:12 +02:00
NFSUTILS_VERSION=1.3.4
2015-04-21 14:54:49 +02:00
NFSUTILS=nfs-utils-$(NFSUTILS_VERSION)
NFSUTILS_SBIN_FILES=utils/showmount/showmount \
utils/exportfs/exportfs \
utils/nfsstat/nfsstat \
utils/mountd/mountd \
utils/statd/start-statd \
utils/statd/sm-notify \
utils/statd/statd \
utils/nfsd/nfsd
2017-05-03 17:04:12 +02:00
NANO_VERSION=2.8.1
2015-05-22 21:48:07 +02:00
NANO=nano-$(NANO_VERSION)
NANO_FILENAME=$(NANO).tar.gz
2017-05-03 17:04:12 +02:00
NANO_DOWNLOAD=http://www.nano-editor.org/dist/v2.8/$(NANO_FILENAME)
2015-05-22 21:48:07 +02:00
2016-02-23 21:03:57 +01:00
PYTHON3_VERSION0=3.5
PYTHON3_VERSION=$(PYTHON3_VERSION0).6
2016-02-23 21:03:57 +01:00
PYTHON3=Python-$(PYTHON3_VERSION)
PYTHON3_PACKAGE_NAME=$(PYTHON3)-1
2016-02-23 21:03:57 +01:00
PYTHON3_FILENAME=$(PYTHON3).tgz
PYTHON3_DOWNLOAD=https://www.python.org/ftp/python/$(PYTHON3_VERSION)/$(PYTHON3_FILENAME)
MULTICAST_RTP_PACKAGE_NAME=multicast-rtp-2
2016-02-26 20:18:45 +01:00
TVHEADEND_COMMIT=master
# 10663 10937 11234 11398
2018-10-17 12:59:00 +02:00
OSCAM_REV=11434
2015-03-28 09:36:07 +01:00
define GIT_CLONE
2016-02-23 21:03:57 +01:00
@mkdir -p apps/host
2015-03-28 09:36:07 +01:00
git clone $(1) apps/$(2)
cd apps/$(2) && git checkout -b axe $(3)
2015-03-28 09:36:07 +01:00
endef
define WGET
2016-02-23 21:03:57 +01:00
@mkdir -p apps/host
wget --no-verbose --no-check-certificate -O $(2) $(1)
endef
2015-03-28 09:36:07 +01:00
define PACKAGE
-mkdir -p out/packages
tar cvz -C $(1) -f out/packages/$(2).tar.gz $(3)
endef
2015-03-26 20:55:54 +01:00
#
# all
#
.PHONY: all
all: kernel-axe-modules kernel
.PHONY: release
2015-08-10 15:09:15 +02:00
release: kernel-axe-modules out/idl4k.scr out/idl4k.cfgreset out/idl4k.cfgresetusb out/idl4k.recovery
-ls -la out
.PHONY: dist
dist:
-mkdir -p dist
cp out/*.fw out/*.usb out/*.flash dist
2015-03-26 20:55:54 +01:00
#
# create CPIO
#
2015-05-22 21:48:07 +02:00
CPIO_SRCS = kernel-modules
CPIO_SRCS += busybox
CPIO_SRCS += dropbear
CPIO_SRCS += ethtool
CPIO_SRCS += minisatip
2016-02-16 16:46:40 +01:00
CPIO_SRCS += minisatip5
2017-04-25 13:06:33 +02:00
CPIO_SRCS += minisatip7
CPIO_SRCS += minisatip8
2015-05-22 21:48:07 +02:00
CPIO_SRCS += oscam
CPIO_SRCS += tools/axehelper
CPIO_SRCS += nfsutils
CPIO_SRCS += nano
2015-05-24 10:55:58 +02:00
CPIO_SRCS += mtd-utils
2015-05-22 21:48:07 +02:00
fs.cpio: $(CPIO_SRCS)
fakeroot tools/do_min_fs.py \
-r "$(VERSION)" \
2015-05-24 10:55:58 +02:00
-b "bash strace openssl" \
-d "fs-add" \
$(foreach m,$(EXTRA_AXE_MODULES), -e "$(EXTRA_AXE_MODULES_DIR)/$(m):lib/modules/axe/$(m)") \
2015-08-03 16:57:27 +02:00
-e "patches/axe_dmxts_std.ko:lib/modules/axe/axe_dmxts_std.ko" \
2016-07-04 22:54:49 +02:00
-e "patches/axe_fe_157.ko:lib/modules/axe/axe_fe.ko" \
$(foreach m,$(ORIG_FILES), -e "$(EXTRA_AXE_MODULES_DIR)/../$(m):lib/modules/axe/$(m)") \
2015-08-03 16:57:27 +02:00
$(foreach m,$(EXTRA_AXE_LIBS), -e "$(EXTRA_AXE_LIBS_DIR)/$(m):lib/$(m)") \
-e "tools/i2c_mangle.ko:lib/modules/axe/i2c_mangle.ko" \
$(foreach m,$(KMODULES), -e "kernel/$(m):lib/modules/$(m)") \
-e "tools/axehelper:sbin/axehelper" \
-e "apps/$(BUSYBOX)/busybox:bin/busybox" \
$(foreach f,$(DROPBEAR_SBIN_FILES), -e "apps/$(DROPBEAR)/$(f):sbin/$(f)") \
$(foreach f,$(DROPBEAR_BIN_FILES), -e "apps/$(DROPBEAR)/$(f):usr/bin/$(f)") \
-e "apps/$(ETHTOOL)/ethtool:sbin/ethtool" \
2015-04-21 14:54:49 +02:00
$(foreach f,$(RPCBIND_SBIN_FILES), -e "apps/$(RPCBIND)/$(f):usr/sbin/$(f)") \
$(foreach f,$(NFSUTILS_SBIN_FILES), -e "apps/$(NFSUTILS)/$(f):usr/sbin/$(notdir $(f))") \
-e "apps/minisatip/minisatip:sbin/minisatip" \
2016-02-29 18:21:05 +01:00
$(foreach f,$(notdir $(wildcard apps/minisatip/icons/*)), -e "apps/minisatip/icons/$f:usr/share/minisatip/icons/$f") \
2016-02-16 16:46:40 +01:00
-e "apps/minisatip5/minisatip:sbin/minisatip5" \
2016-02-29 18:21:05 +01:00
$(foreach f,$(notdir $(wildcard apps/minisatip5/html/*)), -e "apps/minisatip5/html/$f:usr/share/minisatip/html/$f") \
2017-04-25 13:06:33 +02:00
-e "apps/minisatip7/minisatip:sbin/minisatip7" \
$(foreach f,$(notdir $(wildcard apps/minisatip7/html/*)), -e "apps/minisatip7/html/$f:usr/share/minisatip7/html/$f") \
-e "apps/minisatip8/minisatip:sbin/minisatip8" \
$(foreach f,$(notdir $(wildcard apps/minisatip8/html/*)), -e "apps/minisatip8/html/$f:usr/share/minisatip8/html/$f") \
2015-05-22 21:48:07 +02:00
-e "apps/$(NANO)/src/nano:usr/bin/nano" \
2015-05-24 10:55:58 +02:00
-e "apps/mtd-utils/nandwrite:usr/sbin/nandwrite2" \
-e "apps/oscam-svn/Distribution/oscam-1.20-unstable_svn$(OSCAM_REV)-sh4-linux:sbin/oscamd"
.PHONY: fs-list
fs-list:
cpio -itv < kernel/rootfs-idl4k.cpio
#
# uboot
#
out/idl4k.cfgreset: patches/uboot-cfgreset.script
$(TOOLPATH)/mkimage -T script -C none \
-n 'Reset satip-axe fw configuration' \
-d patches/uboot-cfgreset.script out/idl4k.cfgreset
2015-08-10 15:09:15 +02:00
out/idl4k.cfgresetusb: patches/uboot-cfgresetusb.script
$(TOOLPATH)/mkimage -T script -C none \
-n 'Reset satip-axe fw configuration (USB)' \
-d patches/uboot-cfgresetusb.script out/idl4k.cfgresetusb
out/idl4k.recovery: patches/uboot-recovery.script
$(TOOLPATH)/mkimage -T script -C none \
-n 'Restore original idl4k fw' \
-d patches/uboot-recovery.script out/idl4k.recovery
out/idl4k.scr: patches/uboot.script patches/uboot-flash.script out/satip-axe-$(VERSION).fw
rm -f out/*.scr out/*.usb out/*.flash out/*.recovery
sed -e 's/@VERSION@/$(VERSION)/g' \
< patches/uboot.script > out/uboot.script
sed -e 's/@VERSION@/$(VERSION)/g' \
< patches/uboot-flash.script > out/uboot-flash.script
$(TOOLPATH)/mkimage -T script -C none \
-n 'SAT>IP AXE fw v$(VERSION)' \
-d out/uboot.script out/satip-axe-$(VERSION).usb
$(TOOLPATH)/mkimage -T script -C none \
-n 'SAT>IP AXE fw v$(VERSION)' \
-d out/uboot-flash.script out/satip-axe-$(VERSION).flash
ln -sf satip-axe-$(VERSION).usb out/idl4k.scr
rm out/uboot.script out/uboot-flash.script
out/satip-axe-$(VERSION).fw: kernel/arch/sh/boot/uImage.gz
mkdir -p out
rm -f out/*.fw
cp -av kernel/arch/sh/boot/uImage.gz out/satip-axe-$(VERSION).fw
#
# kernel
#
2016-05-31 16:06:46 +02:00
kernel/.config: patches/kernel.config toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4/bin/sh4-linux-gcc-4.5.3
cp patches/kernel.config ./kernel/arch/sh/configs/idl4k_defconfig
make -C kernel -j $(CPUS) ARCH=sh CROSS_COMPILE=$(TOOLCHAIN_KERNEL)/bin/sh4-linux- idl4k_defconfig
kernel/drivers/usb/serial/cp210x.ko: toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4/bin/sh4-linux-gcc-4.5.3 kernel/.config
make -C kernel -j $(CPUS) ARCH=sh CROSS_COMPILE=$(TOOLCHAIN_KERNEL)/bin/sh4-linux- modules
kernel/arch/sh/boot/uImage.gz: kernel/drivers/usb/serial/cp210x.ko fs.cpio
mv fs.cpio kernel/rootfs-idl4k.cpio
2015-03-26 20:55:54 +01:00
make -C kernel -j ${CPUS} PATH="$(PATH):$(TOOLPATH)" \
ARCH=sh CROSS_COMPILE=$(TOOLCHAIN_KERNEL)/bin/sh4-linux- uImage.gz
tools/i2c_mangle.ko: tools/i2c_mangle.c
make -C tools ARCH=sh CROSS_COMPILE=$(TOOLCHAIN_KERNEL)/bin/sh4-linux- all
.PHONY: kernel-modules tools/i2c_mangle.ko
kernel-modules: kernel/drivers/usb/serial/cp210x.ko
.PHONY: kernel
kernel: kernel/arch/sh/boot/uImage.gz
.PHONY: kernel-mrproper
kernel-mrproper:
2015-04-21 14:54:49 +02:00
make -C kernel -j ${CPUS} ARCH=sh CROSS_COMPILE=$(TOOLCHAIN_KERNEL)/bin/sh4-linux- mrproper
define RPM_UNPACK
@mkdir -p $(1)
cd $(1) ; rpm2cpio ../$(2) | cpio -idv
endef
toolchain/4.5.3-99/opt/STM/STLinux-2.4/devkit/sh4/bin/sh4-linux-gcc-4.5.3:
$(call RPM_UNPACK,toolchain/4.5.3-99,stlinux24-cross-sh4-binutils-2.24.51.0.3-76.i386.rpm)
$(call RPM_UNPACK,toolchain/4.5.3-99,stlinux24-cross-sh4-cpp-4.5.3-99.i386.rpm)
$(call RPM_UNPACK,toolchain/4.5.3-99,stlinux24-cross-sh4-gcc-4.5.3-99.i386.rpm)
#
# extract kernel modules from firmware
#
.PHONY: kernel-axe-modules
kernel-axe-modules: firmware/initramfs/root/modules_idl4k_7108_ST40HOST_LINUX_32BITS/axe_dmx.ko
firmware/initramfs/root/modules_idl4k_7108_ST40HOST_LINUX_32BITS/axe_dmx.ko:
cd firmware ; ../tools/cpio-idl4k-bin.sh extract
chmod -R u+rw firmware/initramfs
2015-04-02 21:42:21 +02:00
#
# syscall dump
#
tools/axehelper: tools/axehelper.c
$(TOOLCHAIN)/bin/sh4-linux-gcc -o tools/axehelper -Wall -lrt tools/axehelper.c
2015-04-15 18:05:21 +02:00
tools/axehelper.$(HOST_ARCH): tools/axehelper.c
gcc -o tools/axehelper.$(HOST_ARCH) -Wall -lrt tools/axehelper.c
2015-04-03 13:20:23 +02:00
tools/syscall-dump.so: tools/syscall-dump.c
$(TOOLCHAIN)/bin/sh4-linux-gcc -o tools/syscall-dump.o -c -fPIC -Wall tools/syscall-dump.c
$(TOOLCHAIN)/bin/sh4-linux-gcc -o tools/syscall-dump.so -shared -rdynamic tools/syscall-dump.o -ldl
tools/syscall-dump.so.$(HOST_ARCH): tools/syscall-dump.c
gcc -o tools/syscall-dump.o.$(HOST_ARCH) -c -fPIC -Wall tools/syscall-dump.c
gcc -o tools/syscall-dump.so.$(HOST_ARCH) -shared -rdynamic tools/syscall-dump.o.$(HOST_ARCH) -ldl
.PHONY: s2i_dump
s2i_dump: tools/syscall-dump.so
if test -z "$(SATIP_HOST)"; then echo "Define SATIP_HOST variable"; exit 1; fi
2015-04-09 19:49:35 +02:00
cd firmware/initramfs && tar cvzf ../fw.tgz --owner=root --group=root *
scp tools/syscall-dump.so tools/s2i-dump.sh firmware/fw.tgz \
root@$(SATIP_HOST):/root
2015-04-02 21:42:21 +02:00
#
# media_build
#
apps/media/build:
$(call GIT_CLONE,git://linuxtv.org/media_build.git,media,master)
$(call WGET,http://www.linuxtv.org/downloads/firmware/dvb-firmwares.tar.bz2,apps/media/dvb-firmwares.tar.bz2)
make -C apps/media download untar
apps/media/v4l/dib0070.h: apps/media/build
make -C apps/media SRCDIR=$(CURDIR)/kernel VER=2.6.32 allyesconfig
make -C apps/media SRCDIR=$(CURDIR) VER=2.6.32
.PHONY: media
media: apps/media/v4l/dib0070.h
.PHONY: media-clean
media-clean:
rm -rf apps/media
2015-03-28 09:36:07 +01:00
#
# minisatip
#
2016-02-29 18:21:05 +01:00
apps/minisatip/axe.h: patches/minisatip-axe.patch
rm -rf apps/minisatip
$(call GIT_CLONE,https://github.com/catalinii/minisatip.git,minisatip,$(MINISATIP_COMMIT))
cd apps/minisatip; patch -p1 < ../../patches/minisatip-axe.patch
2015-03-28 09:36:07 +01:00
apps/minisatip/minisatip: apps/minisatip/axe.h
2015-03-28 09:36:07 +01:00
make -C apps/minisatip \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2 -DAXE=1 -DSYS_DVBT2=16 -I$(CURDIR)/kernel/include"
2015-03-28 09:36:07 +01:00
.PHONY: minisatip
minisatip: apps/minisatip/minisatip
.PHONY: minisatip-clean
minisatip-clean:
rm -rf apps/minisatip
2016-02-16 16:46:40 +01:00
#
# minisatip5
#
2016-02-29 18:21:05 +01:00
apps/minisatip5/axe.h: patches/minisatip5-axe.patch
rm -rf apps/minisatip5
2016-02-16 16:46:40 +01:00
$(call GIT_CLONE,https://github.com/catalinii/minisatip.git,minisatip5,$(MINISATIP5_COMMIT))
cd apps/minisatip5; patch -p1 < ../../patches/minisatip5-axe.patch
apps/minisatip5/minisatip: apps/minisatip5/axe.h
2016-03-23 12:09:58 +01:00
cd apps/minisatip5 && ./configure \
--disable-dvbca \
--disable-dvbcsa \
--disable-dvbaes \
--disable-netceiver
2016-02-16 16:46:40 +01:00
make -C apps/minisatip5 \
DVBCSA= \
DVBCA= \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2 -DAXE=1 -DSYS_DVBT2=16 \
2016-03-23 12:09:58 +01:00
-DDISABLE_DVBAPI -DDISABLE_DVBCSA -DDISABLE_DVBCA \
-DDISABLE_TABLES -DDISABLE_NETCVCLIENT \
2016-02-16 16:46:40 +01:00
-I$(CURDIR)/kernel/include"
.PHONY: minisatip5
minisatip5: apps/minisatip5/minisatip
.PHONY: minisatip5-clean
minisatip5-clean:
rm -rf apps/minisatip5
2017-04-25 13:06:33 +02:00
#
# minisatip7
#
apps/minisatip7/axe.h: patches/minisatip7-axe.patch
rm -rf apps/minisatip7
$(call GIT_CLONE,https://github.com/perexg/minisatip.git,minisatip7,$(MINISATIP7_COMMIT))
2017-04-25 13:06:33 +02:00
cd apps/minisatip7; patch -p1 < ../../patches/minisatip7-axe.patch
apps/minisatip7/minisatip: apps/minisatip7/axe.h
cd apps/minisatip7 && ./configure \
--enable-axe \
--disable-dvbca \
--disable-dvbapi \
2017-04-25 13:06:33 +02:00
--disable-dvbcsa \
--disable-dvbaes \
--disable-netceiver
make -C apps/minisatip7 \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
EXTRA_CFLAGS="-O2 -I$(CURDIR)/kernel/include"
.PHONY: minisatip7
minisatip7: apps/minisatip7/minisatip
.PHONY: minisatip7-clean
minisatip7-clean:
rm -rf apps/minisatip7
#
# minisatip8
#
apps/minisatip8/src/axe.h: patches/minisatip8-axe.patch
rm -rf apps/minisatip8
$(call GIT_CLONE,https://github.com/catalinii/minisatip.git,minisatip8,$(MINISATIP8_COMMIT))
cd apps/minisatip8; patch -p1 < ../../patches/minisatip8-axe.patch
apps/minisatip8/minisatip: apps/minisatip8/src/axe.h
cd apps/minisatip8 && ./configure \
--enable-axe \
--disable-dvbca \
--disable-dvbapi \
--disable-dvbcsa \
--disable-dvbaes \
--disable-netceiver
make -C apps/minisatip8 \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
EXTRA_CFLAGS="-O2 -I$(CURDIR)/kernel/include"
.PHONY: minisatip8
minisatip8: apps/minisatip8/minisatip
.PHONY: minisatip8-clean
minisatip8-clean:
rm -rf apps/minisatip8
2016-03-23 12:09:58 +01:00
#
# minisatip package
#
dist/packages/minisatip-$(VERSION).tar.gz: minisatip minisatip5 minisatip7 minisatip8
2016-03-23 12:09:58 +01:00
rm -rf fs/usr/share/minisatip
2017-04-25 13:06:33 +02:00
mkdir -p fs/usr/share/minisatip/icons/ \
fs/usr/share/minisatip/html/ \
fs/usr/share/minisatip7/html/ \
fs/usr/share/minisatip8/html/
2016-03-23 12:09:58 +01:00
install -m 755 apps/minisatip/minisatip fs/sbin/minisatip
install -m 644 apps/minisatip/icons/* fs/usr/share/minisatip/icons/
install -m 755 apps/minisatip5/minisatip fs/sbin/minisatip5
install -m 644 apps/minisatip5/html/* fs/usr/share/minisatip/html/
2017-04-25 13:06:33 +02:00
install -m 755 apps/minisatip7/minisatip fs/sbin/minisatip7
install -m 644 apps/minisatip7/html/* fs/usr/share/minisatip7/html/
install -m 755 apps/minisatip8/minisatip fs/sbin/minisatip8
install -m 644 apps/minisatip8/html/* fs/usr/share/minisatip7/html8
2016-03-23 12:09:58 +01:00
tar cvz -C fs -f dist/packages/minisatip-$(VERSION).tar.gz \
sbin/minisatip \
sbin/minisatip5 \
usr/share/minisatip/icons \
2017-04-25 13:06:33 +02:00
usr/share/minisatip/html \
usr/share/minisatip7/html \
usr/share/minisatip8/html
2016-03-23 12:09:58 +01:00
ls -la dist/packages/minisatip*
.PHONY: minisatip-package
minisatip-package: dist/packages/minisatip-$(VERSION).tar.gz
#
# busybox
#
apps/$(BUSYBOX)/Makefile:
$(call WGET,http://busybox.net/downloads/$(BUSYBOX).tar.bz2,apps/$(BUSYBOX).tar.bz2)
tar -C apps -xjf apps/$(BUSYBOX).tar.bz2
apps/$(BUSYBOX)/busybox: apps/$(BUSYBOX)/Makefile
make -C apps/$(BUSYBOX) CROSS_COMPILE=$(TOOLCHAIN)/bin/sh4-linux- defconfig
make -C apps/$(BUSYBOX) CROSS_COMPILE=$(TOOLCHAIN)/bin/sh4-linux-
.PHONY: busybox
busybox: apps/$(BUSYBOX)/busybox
#
# dropbear
#
apps/$(DROPBEAR)/configure:
2016-02-01 18:12:33 +01:00
$(call WGET,https://matt.ucc.asn.au/dropbear/releases/$(DROPBEAR).tar.bz2,apps/$(DROPBEAR).tar.bz2)
tar -C apps -xjf apps/$(DROPBEAR).tar.bz2
apps/$(DROPBEAR)/dropbear: apps/$(DROPBEAR)/configure
cd apps/$(DROPBEAR) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
./configure \
--host=sh4-linux \
--prefix=/ \
--disable-lastlog \
--disable-utmp \
--disable-utmpx \
--disable-wtmp \
--disable-wtmpx
sed -e 's/DEFAULT_PATH \"\/usr\/bin:\/bin\"/DEFAULT_PATH \"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin:\/usr\/local\/bin\"/g' \
< apps/$(DROPBEAR)/options.h > apps/$(DROPBEAR)/options.h.2
mv apps/$(DROPBEAR)/options.h.2 apps/$(DROPBEAR)/options.h
make -C apps/$(DROPBEAR) PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
.PHONY: dropbear
dropbear: apps/$(DROPBEAR)/dropbear
#
# ethtool
#
apps/$(ETHTOOL)/configure:
$(call WGET,https://www.kernel.org/pub/software/network/ethtool/$(ETHTOOL).tar.gz,apps/$(ETHTOOL).tar.gz)
tar -C apps -xzf apps/$(ETHTOOL).tar.gz
apps/$(ETHTOOL)/ethtool: apps/$(ETHTOOL)/configure
cd apps/$(ETHTOOL) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
./configure \
--host=sh4-linux \
--prefix=/
make -C apps/$(ETHTOOL)
.PHONY: ethtool
ethtool: apps/$(ETHTOOL)/ethtool
#
# mtd-utils
#
apps/mtd-utils/Makefile:
$(call GIT_CLONE,git://git.infradead.org/mtd-utils.git,mtd-utils,$(MTD_UTILS_COMMIT))
apps/mtd-utils/nanddump: apps/mtd-utils/Makefile
make -C apps/mtd-utils \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2 -I$(CURDIR)/kernel/include"
.PHONY: mtd-utils
mtd-utils: apps/mtd-utils/nanddump
2015-04-21 14:54:49 +02:00
#
# libtirpc
#
apps/$(LIBTIRPC)/configure:
$(call WGET,http://sourceforge.net/projects/libtirpc/files/libtirpc/$(LIBTIRPC_VERSION)/$(LIBTIRPC).tar.bz2,apps/$(LIBTIRPC).tar.bz2)
tar -C apps -xjf apps/$(LIBTIRPC).tar.bz2
apps/$(LIBTIRPC)/src/.libs/libtirpc.a: apps/$(LIBTIRPC)/configure
cd apps/$(LIBTIRPC) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
./configure \
--host=sh4-linux \
--prefix=/ \
--disable-shared \
--disable-gssapi \
--disable-ipv6
make -C apps/$(LIBTIRPC)
.PHONY: libtirpc
libtirpc: apps/$(LIBTIRPC)/src/.libs/libtirpc.a
#
# rpcbind
#
apps/$(RPCBIND)/configure:
$(call WGET,http://sourceforge.net/projects/rpcbind/files/rpcbind/$(RPCBIND_VERSION)/$(RPCBIND).tar.bz2,apps/$(RPCBIND).tar.bz2)
tar -C apps -xjf apps/$(RPCBIND).tar.bz2
apps/$(RPCBIND)/rpcbind: apps/$(LIBTIRPC)/src/.libs/libtirpc.a apps/$(RPCBIND)/configure
cd apps/$(RPCBIND) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
TIRPC_CFLAGS="-I$(PWD)/apps/$(LIBTIRPC)/tirpc" \
TIRPC_LIBS="-L$(PWD)/apps/$(LIBTIRPC)/src/.libs -Wl,-Bstatic -ltirpc -Wl,-Bdynamic" \
./configure \
--host=sh4-linux \
--prefix=/ \
--with-systemdsystemunitdir=no
make -C apps/$(RPCBIND)
.PHONY: rpcbind
rpcbind: apps/$(RPCBIND)/rpcbind
#
# nfs-utils
#
apps/$(NFSUTILS)/configure:
$(call WGET,http://sourceforge.net/projects/nfs/files/nfs-utils/$(NFSUTILS_VERSION)/$(NFSUTILS).tar.bz2,apps/$(NFSUTILS).tar.bz2)
tar -C apps -xjf apps/$(NFSUTILS).tar.bz2
apps/$(NFSUTILS)/utils/exportfs/exportfs: apps/$(RPCBIND)/rpcbind apps/$(NFSUTILS)/configure
cd apps/$(NFSUTILS) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
TIRPC_CFLAGS="-I$(PWD)/apps/$(LIBTIRPC)/tirpc" \
TIRPC_LIBS="-L$(PWD)/apps/$(LIBTIRPC)/src/.libs -Wl,-Bstatic -ltirpc -Wl,-Bdynamic" \
./configure \
--host=sh4-linux \
--prefix=/ \
--disable-mount \
--disable-nfsdcltrack \
--disable-nfsv4 \
--disable-gss \
--disable-ipv6 \
--disable-uuid \
--without-tcp-wrappers
make -C apps/$(NFSUTILS)
.PHONY: nfsutils
nfsutils: apps/$(NFSUTILS)/utils/exportfs/exportfs
#
# oscam
#
apps/oscam-svn/config.sh:
cd apps && svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-svn -r $(OSCAM_REV)
apps/oscam-svn/Distribution/oscam-1.20-unstable_svn$(OSCAM_REV)-sh4-linux: apps/oscam-svn/config.sh
make -C apps/oscam-svn CROSS_DIR=$(TOOLCHAIN)/bin/ CROSS=sh4-linux-
.PHONY: oscam
oscam: apps/oscam-svn/Distribution/oscam-1.20-unstable_svn$(OSCAM_REV)-sh4-linux
2015-05-22 21:48:07 +02:00
#
# nano
#
apps/$(NANO)/configure:
$(call WGET,$(NANO_DOWNLOAD),apps/$(NANO_FILENAME))
tar -C apps -xzf apps/$(NANO_FILENAME)
apps/$(NANO)/src/nano: apps/$(NANO)/configure
2015-05-22 21:48:07 +02:00
cd apps/$(NANO) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
./configure \
--host=sh4-linux \
2016-02-01 18:12:33 +01:00
--disable-utf8 \
2015-05-22 21:48:07 +02:00
--prefix=/
make -C apps/$(NANO)
.PHONY: nano
nano: apps/$(NANO)/src/nano
2015-05-22 21:48:07 +02:00
2016-02-23 21:03:57 +01:00
#
# python3-host
#
apps/host/$(PYTHON3)/pyconfig.h.in:
$(call WGET,$(PYTHON3_DOWNLOAD),apps/host/$(PYTHON3_FILENAME))
tar -C apps/host -xzf apps/host/$(PYTHON3_FILENAME)
apps/host/$(PYTHON3)/python: apps/host/$(PYTHON3)/pyconfig.h.in
cd apps/host/$(PYTHON3) && \
./configure
make -C apps/host/$(PYTHON3)
.PHONY: python3-host
python3-host: apps/host/$(PYTHON3)/python
#
# python3
#
apps/$(PYTHON3)/pyconfig.h.in:
$(call WGET,$(PYTHON3_DOWNLOAD),apps/$(PYTHON3_FILENAME))
tar -C apps -xzf apps/$(PYTHON3_FILENAME)
apps/$(PYTHON3)/patch.stamp: apps/$(PYTHON3)/pyconfig.h.in apps/host/$(PYTHON3)/python
cd apps/$(PYTHON3) && \
PKG_CONFIG_PATH=$(TOOLCHAIN)/target/usr/lib/pkgconfig \
PKG_CONFIG=$(TOOLPATH)/pkg-config \
ARCH=sh \
CPP=$(TOOLCHAIN)/bin/sh4-linux-cpp \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
READELF=/usr/bin/readelf \
PYTHON_FOR_BUILD=$(CURDIR)/apps/host/$(PYTHON3)/python \
CONFIG_SITE=$(CURDIR)/patches/python3.config.site \
./configure \
--host=sh4-linux \
--build=x86_64-redhat-linux \
--target=sh4-linux \
--sysconfdir=/etc \
--prefix=/usr \
--enable-ipv6=no
cd apps/$(PYTHON3) && patch -b -p0 < ../../patches/python3-makefile.patch
cd apps/$(PYTHON3) && patch -b -p0 < ../../patches/python3-setup.patch
cd apps/$(PYTHON3) && patch -b -p0 < ../../patches/python3-ccompiler.patch
cd apps/$(PYTHON3) && patch -b -p0 < ../../patches/python3-build-ext.patch
cd apps/$(PYTHON3) && patch -b -p0 < ../../patches/python3-getpath.patch
2016-02-23 21:03:57 +01:00
touch apps/$(PYTHON3)/patch.stamp
apps/$(PYTHON3)/compiled.stamp: apps/$(PYTHON3)/patch.stamp
rm -rf $(CURDIR)/apps/$(PYTHON3)/dest
PYTHONPATH=$(CURDIR)/apps/$(PYTHON3)/Lib \
2016-02-24 20:16:41 +01:00
make -C apps/$(PYTHON3) \
2016-02-23 21:03:57 +01:00
PYINCDIRS="$(CURDIR)/apps/$(PYTHON3):$(CURDIR)/apps/$(PYTHON3)/Include" \
PYLIBS="." \
CROSS_COMPILE=yes \
ABIFLAGS="" \
PYTHON_FOR_BUILD=$(CURDIR)/apps/host/$(PYTHON3)/python \
PGEN=$(CURDIR)/apps/host/$(PYTHON3)/Parser/pgen \
FREEZE_IMPORTLIB=$(CURDIR)/apps/host/$(PYTHON3)/Programs/_freeze_importlib \
PYTHONPATH=$(CURDIR)/apps/$(PYTHON3)/Lib \
PYTHON_OPTIMIZE="" \
PYTHONDONTWRITEBYTECODE=1 \
_PYTHON_HOST_PLATFORM=linux-sh4 \
DESTDIR=$(CURDIR)/apps/$(PYTHON3)/dest \
sharedmods sharedinstall libinstall bininstall
rm -f apps/$(PYTHON3)/dest/usr/bin/python*-config
rm -f apps/$(PYTHON3)/dest/usr/bin/2to3*
rm -f apps/$(PYTHON3)/dest/usr/bin/idle*
$(TOOLCHAIN)/bin/sh4-linux-strip apps/$(PYTHON3)/dest/usr/bin/python3*
rm -f apps/$(PYTHON3)/dest/usr/lib/*.a
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/test
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/ctypes/test
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/sqlite3
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/turtle*
rm -f apps/$(PYTHON3)/dest/usr/lib/python3*/__pycache__/turtle*
rm -f apps/$(PYTHON3)/dest/usr/lib/python3*/lib-dynload/*test*
rm -f apps/$(PYTHON3)/dest/usr/lib/python3*/lib-dynload/*audio*
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/lib2to3
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/unittest
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/tkinter
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/idlelib
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/distutils
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/ensurepip
rm -rf apps/$(PYTHON3)/dest/usr/lib/python3*/curses
2016-02-23 21:03:57 +01:00
find $(CURDIR)/apps/$(PYTHON3)/dest/usr/lib/ -name "*.opt-[12].pyc" -exec rm {} \;
find $(CURDIR)/apps/$(PYTHON3)/dest/usr/lib/ -name "test_*" -exec rm {} \;
$(call PACKAGE,apps/$(PYTHON3)/dest,$(PYTHON3_PACKAGE_NAME),usr)
2016-02-23 21:03:57 +01:00
touch apps/$(PYTHON3)/compiled.stamp
.PHONY: python3
python3: apps/$(PYTHON3)/compiled.stamp
2016-02-26 20:18:45 +01:00
#
# multicast-rtp
#
apps/multicast-rtp/ok.stamp: tools/multicast-rtp
mkdir -p apps/multicast-rtp/sbin apps/multicast-rtp/etc/init.extra
cp tools/multicast-rtp apps/multicast-rtp/sbin
ln -sf ../../sbin/multicast-rtp apps/multicast-rtp/etc/init.extra/multicast-rtp
$(call PACKAGE,apps/multicast-rtp,$(MULTICAST_RTP_PACKAGE_NAME),etc sbin)
touch apps/multicast-rtp/ok.stamp
.PHONY: multicast-rtp
multicast-rtp: apps/multicast-rtp/ok.stamp
#
# tvheadend
#
apps/tvheadend/Makefile:
$(call GIT_CLONE,https://github.com/tvheadend/tvheadend.git,tvheadend,$(TVHEADEND_COMMIT))
apps/tvheadend/build.linux/tvheadend: apps/tvheadend/Makefile
cd apps/tvheadend && \
PKG_CONFIG_PATH=$(TOOLCHAIN)/target/usr/lib/pkgconfig \
PKG_CONFIG=$(TOOLPATH)/pkg-config \
ARCH=sh \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
./configure \
--disable-dbus_1 \
--disable-imagecache \
2015-05-22 20:37:54 +02:00
--disable-uriparser \
--enable-bundle
$(MAKE) -j $(CPUS) -C apps/tvheadend
.PHONY: tvheadend
tvheadend: apps/tvheadend/build.linux/tvheadend
#
# clean all
#
2015-03-26 20:55:54 +01:00
.PHONY: clean
clean: kernel-mrproper
rm -rf firmware/initramfs
rm -rf toolchain/4.5.3-99
2015-04-03 13:20:23 +02:00
rm -rf tools/syscall-dump.o* tools/syscall-dump.s*
2016-02-29 18:21:05 +01:00
testx:
echo $(foreach f,$(notdir $(wildcard apps/minisatip5/html/*)), "'$f'")