#!/bin/bash INCLUDES=$2 BIN=tmp if [ "$1" = "bt6702" ]; then SRC=$'#define HARDWARE_BT6702 1\r\n#include \r\n#include "common_config.h"\r\n' elif [ "$1" = "bt6706" ]; then SRC=$'#define HARDWARE_BT6706 1\r\n#include \r\n#include "common_config.h"\r\n' elif [ "$1" = "bt6708" ]; then SRC=$'#define HARDWARE_BT6708 1\r\n#include \r\n#include "common_config.h"\r\n' fi SRC+=$'int main(int argc, char *argv[]) {printf("%s", VERSION);}' echo "$SRC" > $BIN.c gcc -w $INCLUDES $BIN.c -o $BIN && chmod +x $BIN && VERSION=$(./$BIN) rm $BIN $BIN.c echo $VERSION