#!/bin/sh

tce-load -w compiletc  sstrip squashfs-tools submitqc
tce-load -i compiletc  sstrip squashfs-tools submitqc

EXTNAME="hyx"
EXTVERSION="2020.12.24"
EXTDIRNAME="$EXTNAME-$EXTVERSION"
TARNAME="$EXTDIRNAME.tar.xz"

cd /tmp

[ -e "$TARNAME" ] || wget https://yx7.cc/code/"$EXTNAME"/"$TARNAME"

sudo rm -rf "$EXTNAME"  "$EXTNAME"*.tcz*

tar x -Jf "$TARNAME"


cd "$EXTDIRNAME"

export CFLAGS=" -flto -march=i486 -mtune=i686 -Os -pipe -fno-plt -Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn"

make
