-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.bat
46 lines (39 loc) · 1.93 KB
/
Makefile.bat
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
39
40
41
42
43
44
45
46
@ECHO OFF
REM generated with tools\mkmk.pl MAKEFILE.SPEC
REM === create output directory ===============================================
if not exist _output mkdir _output
REM === assemble MIOS SDCC wrapper and device specific setup ==================
echo Assembling MIOS SDCC wrapper
gpasm -c -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I mios_wrapper mios_wrapper\mios_wrapper.asm -o _output\mios_wrapper.o
if errorlevel 1 goto end_error
REM === Build the project files ===============================================
echo ==========================================================================
echo Compiling pic18f452.c
sdcc -S -mpic16 -p18F452 --fstack --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2 -pleave-reset-vector -DDEBUG_MODE=0 pic18f452.c -o _output\pic18f452.asm
if errorlevel 1 goto end_error
perl tools\fixasm.pl _output\pic18f452.asm
if errorlevel 1 goto end_error
gpasm -c _output\pic18f452.asm -o _output\pic18f452.o
if errorlevel 1 goto end_error
echo ==========================================================================
echo Compiling main.c
sdcc -S -mpic16 -p18F452 --fstack --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2 -pleave-reset-vector -DDEBUG_MODE=0 main.c -o _output\main.asm
if errorlevel 1 goto end_error
perl tools\fixasm.pl _output\main.asm
if errorlevel 1 goto end_error
gpasm -c _output\main.asm -o _output\main.o
if errorlevel 1 goto end_error
echo ==========================================================================
echo Linking project
gplink -s project.lkr -m -o project.hex _output\*.o
if errorlevel 1 goto end_error
echo ==========================================================================
echo Converting to project.syx
perl tools\hex2syx.pl project.hex
if errorlevel 1 goto end_error
echo ==========================================================================
echo SUCCESS!
goto :end
:end_error
echo ERROR!
:end