#!/bin/bash
echo "Building V2GDecoder..."

# bin 폴더 생성
mkdir -p bin

gcc -o bin/V2GDecoder V2GDecoder.c \
    src/iso1/*.c \
    src/iso2/*.c \
    src/din/*.c \
    src/codec/*.c \
    -I./src/codec \
    -I./src/iso1 \
    -I./src/iso2 \
    -I./src/din \
    -Wall -O2

if [ $? -eq 0 ]; then
    echo "Build successful! bin/V2GDecoder created."
    echo
    echo "Usage:"
    echo "  ./bin/V2GDecoder ../Sample/test5.exi"
else
    echo "Build failed with error code $?"
    exit 1
fi