Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed ALink42p
Binary file not shown.
Binary file removed ALink42q
Binary file not shown.
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)

Binary file removed alink_drone
Binary file not shown.
55 changes: 55 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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