From 6f62e674d5bde3b1948aca17373bab37bdd0edb6 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Tue, 12 May 2026 21:38:08 -0400 Subject: [PATCH] Make mkcontrollers script work when building as a submodule --- mkcontrollermappings.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mkcontrollermappings.sh b/mkcontrollermappings.sh index a52f39e..9325e53 100755 --- a/mkcontrollermappings.sh +++ b/mkcontrollermappings.sh @@ -1,10 +1,12 @@ #!/bin/bash +rootdir=$1 + curl https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt | grep -v '^#' | grep -v '^$' | sed s/',$'//g > mappings.txt filelen=$(wc -l mappings.txt | cut -d ' ' -f 1) -cat > ../include/akgl/SDL_GameControllerDB.h < ${rootdir}/include/akgl/SDL_GameControllerDB.h <> ../include/akgl/SDL_GameControllerDB.h; + printf ",\n" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h; fi - printf " \"${LINE}\"" >> ../include/akgl/SDL_GameControllerDB.h; + printf " \"${LINE}\"" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h; counter=$((counter + 1)) done -printf "\n};\n" >> ../include/akgl/SDL_GameControllerDB.h -printf "#endif // _SDL_GAMECONTROLLERDB_H_\n" >> ../include/akgl/SDL_GameControllerDB.h +printf "\n};\n" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h +printf "#endif // _SDL_GAMECONTROLLERDB_H_\n" >> ${rootdir}/include/akgl/SDL_GameControllerDB.h