forked from gicking/STM8-SPL_SDCC_patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply_patch.sh
executable file
·26 lines (20 loc) · 880 Bytes
/
apply_patch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# open terminal on double-click, skip else. See https://www.linuxquestions.org/questions/programming-9/executing-shell-script-in-terminal-directly-with-a-double-click-370091/
tty -s; if [ $? -ne 0 ]; then /etc/alternatives/x-terminal-emulator -e "$0"; exit; fi
# change to current working directory
cd `dirname $0`
# just for output
echo off
clear
# set folders to patch
#PATCHFILE=./STM8L10x_StdPeriph_Lib_V1.2.1_sdcc.patch
#PATCHFILE=./STM8L15x-16x-05x-AL31-L_StdPeriph_Lib_V1.6.2_sdcc.patch
PATCHFILE=./STM8S_StdPeriph_Lib_V2.3.1_sdcc.patch
#PATCHFILE=./STM8TL5x_StdPeriph_Lib_V1.0.1.patch
# use patch command to apply patchfile
# https://stackoverflow.com/questions/9980186/how-to-create-a-patch-for-a-whole-directory-to-update-it
# -p0 == needed to find the proper folder
patch -p0 < $PATCHFILE
echo " "
read -p "press key to close window..."
echo on