diff --git a/ALink42p b/ALink42p deleted file mode 100644 index 7232436..0000000 Binary files a/ALink42p and /dev/null differ diff --git a/ALink42q b/ALink42q deleted file mode 100644 index a7db335..0000000 Binary files a/ALink42q and /dev/null differ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8cbaa83 --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +# Get the current date and time in the format YYYYMMDD_HHMMSS +VERSION_STRING := $(shell date +"%Y%m%d_%H%M%S") +CFLAGS ?= +CFLAGS += -Wno-address-of-packed-member -DVERSION_STRING="\"$(VERSION_STRING)\"" + +TARGET_DRONE :=alink_drone +SRCS_DRONE := $(TARGET_DRONE).c + +OUTPUT ?= $(PWD) +BUILD_DRONE = $(CC) $(SRCS_DRONE) -I$(TOOLCHAIN)/usr/include -L$(DRV) $(CFLAGS) $(LIB) -levent_core -Os -s -o $(OUTPUT)/$(TARGET_DRONE) + + +clean: + rm -f *.o $(TARGET_DRONE) + +goke: + $(eval CFLAGS += -D__GOKE__) + $(eval LIB = -lm) + $(BUILD_DRONE) + +hi3516: + $(eval CFLAGS += -D__HI3516__) + $(eval LIB = -lm) + $(BUILD_DRONE) + +star6b0: + $(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6B0__) + $(eval LIB = -lm) + $(BUILD_DRONE) + +star6c: + $(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6C__) + $(eval LIB = -lm) + $(BUILD_DRONE) + +star6e: + $(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6E__) + $(eval LIB = -lm) + $(BUILD_DRONE) + +native: + $(eval CFLAGS += -D_x86) + $(eval LIB = -lm) + $(eval BUILD = $(CC) $(SRCS) -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)) + $(BUILD_DRONE) + diff --git a/alink_drone b/alink_drone deleted file mode 100644 index 96b1f16..0000000 Binary files a/alink_drone and /dev/null differ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..c16ff7e --- /dev/null +++ b/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash +DL="https://github.com/OpenIPC/firmware/releases/download/toolchain/toolchain" + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 [goke|hi3516|star6b0|star6e|star6c|native]" + exit 1 +fi + +if [[ "$1" == *"goke" ]]; then + CC=goke-gk7205v200 +elif [[ "$1" == *"hi3516" ]]; then + CC=hisilicon-hi3516ev200 +elif [[ "$1" == *"star6b0" ]]; then + CC=sigmastar-infinity6b0 +elif [[ "$1" == *"star6e" ]]; then + CC=sigmastar-infinity6e +elif [[ "$1" == *"star6c" ]]; then + CC=sigmastar-infinity6c +fi + +if [[ "$1" != *"native"* ]]; then + if [ ! -e toolchain/$CC ]; then + wget -c -q --show-progress $DL.$CC.tgz -P $PWD + mkdir -p toolchain/$CC + tar -xf toolchain.$CC.tgz -C toolchain/$CC --strip-components=1 || exit 1 + rm -f $CC.tgz + fi + OUT=msposd_$1 +fi + +if [ ! -e firmware ]; then + git clone https://github.com/openipc/firmware --depth=1 +fi + +GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc + +if [ "$1" = "goke" ]; then + DRV=$PWD/firmware/general/package/goke-osdrv-gk7205v200/files/lib + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC $1 +elif [ "$1" = "hi3516" ]; then + DRV=$PWD/firmware/general/package/hisilicon-osdrv-hi3516ev200/files/lib + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC $1 +elif [ "$1" = "star6b0" ]; then + DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6b0/files/lib + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC $1 +elif [ "$1" = "star6e" ]; then + DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6e/files/lib + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC $1 +elif [ "$1" = "star6c" ]; then + DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6c/files/lib + make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC $1 +else + DRV=$PWD + make DRV=$DRV $1 +fi