#!/bin/bash BUILD=build SRC=src A32=arm-linux-gnueabihf- A64=aarch64-linux-gnu- X64= mkdir -p ${BUILD} OPTS=(O0 O1 O2 O3) CFILES=(ardupilot paparazzi cleanflight linux_color_cvt ntc_thermistor arduino_sensorkit pathtracing) for opt in ${OPTS[@]} do for f in ${CFILES[@]} do # Compile ${A64}gcc -${opt} -o ${BUILD}/${f}_aarch64_${opt}.elf ${SRC}/${f}.c -lm ${X64}gcc -${opt} -o ${BUILD}/${f}_x64_${opt}.elf ${SRC}/${f}.c -lm ${A32}gcc -${opt} -o ${BUILD}/${f}_arm32_${opt}.elf ${SRC}/${f}.c -lm # Generate ASM source ${A64}gcc -S -${opt} -o ${BUILD}/${f}_aarch64_${opt}.s ${SRC}/${f}.c ${X64}gcc -S -${opt} -o ${BUILD}/${f}_x64_${opt}.s ${SRC}/${f}.c ${A32}gcc -S -${opt} -o ${BUILD}/${f}_arm32_${opt}.s ${SRC}/${f}.c done # Compile ${A64}gfortran -std=gnu -${opt} -o ${BUILD}/nn_funcs_aarch64_${opt}.elf ${SRC}/nn_funcs.f90 ${X64}gfortran -std=gnu -${opt} -o ${BUILD}/nn_funcs_x64_${opt}.elf ${SRC}/nn_funcs.f90 ${A32}gfortran -std=gnu -${opt} -o ${BUILD}/nn_funcs_arm32_${opt}.elf ${SRC}/nn_funcs.f90 # Generate ASM source ${A64}gfortran -S -std=gnu -${opt} -o ${BUILD}/nn_funcs_aarch64_${opt}.s ${SRC}/nn_funcs.f90 ${X64}gfortran -S -std=gnu -${opt} -o ${BUILD}/nn_funcs_x64_${opt}.s ${SRC}/nn_funcs.f90 ${A32}gfortran -S -std=gnu -${opt} -o ${BUILD}/nn_funcs_arm32_${opt}.s ${SRC}/nn_funcs.f90 done