-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·39 lines (29 loc) · 992 Bytes
/
make.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
27
28
29
30
31
32
33
34
35
36
37
38
INCLUDES="-I/home/dalmir/Dropbox/Microcontrollers/picnix/ \
-I/home/dalmir/storage/github/pic/sdcc/driver/graphic/lcd/ \
-I/home/dalmir/storage/github/pic/sdcc/library/graphic/lcd/ \
-I/home/dalmir/storage/github/pic/sdcc/driver/graphic/glcd/ \
-I/home/dalmir/storage/github/pic/sdcc/library/graphic/glcd/ \
-I/home/dalmir/storage/github/pic/sdcc/include/util/step_report/ \
-I/home/dalmir/storage/github/pic/sdcc/include/ "
BUILD_DIR=build
TARGET=main
ARCH=-mpic16
CHIP=-p18f4550
LKR="-Wl,-s,/home/dalmir/storage/github/glcd/custom_linker.lkr"
echo "Making..."
if [ ! -d $BUILD_DIR ]; then
mkdir $BUILD_DIR
fi
rm $BUILD_DIR/*.c
rm $BUILD_DIR/*.h
cp *.c $BUILD_DIR
cp *.h $BUILD_DIR
cd $BUILD_DIR
echo "Entering in the build dir (${BUILD_DIR})"
echo -n "Compiling..."
sdcc --opt-code-size $LKR $TARGET.c $INCLUDES $ARCH $CHIP
echo "ok."
cp $TARGET.hex ..
cd ..
echo "Exiting the build dir (${BUILD_DIR})"
echo "done."