Hello!
I have a project that used to be compiled via IDE. As I didn't like the IDE much, I made a 'make' script to compile it. I had to use extended syntax so it will run on NT-XP, not Win98 and the like.
Host OS: Windows XP Target: PIC18F452 CPU Language: C Compiler: HI-TECH C Compiler IDE: MPLAB IDE
Target is an embedded CPU, so I compile code on host machine then write it to CPU using a programmer (specialized piece of hardware). Currently I can only do this from IDE, but I hope I will be able to use command-line tool for this.
I see many projects that come from Unix land use 'make', on the other hand, Maranda IM project, for one, upon brief examination, excessively uses Windows' .bat files to build.
So here's my question:
Am I doing the Right Thing or am I reinventing the wheel when I use scripts for which there is a well working tool (make) ?
Best regards, Nickolai Leschov
Here's the script (make.bat):
set PROJECT_NAME=6.2.ver set PROJECT_BASE=\WORK\IKG\IKG-6 set COMPILER_PATH=C:\HTSOFT\PIC18\bin set COMPILER_NAME=picc18.exe set CPU=18F452
set SOURCE_FILES=EE_AT INI MI2C ISR START RD_WR CF48T TIME COMMON SIGNAL TEST MAIN SUPERVISOR KEY1 KEY2 KEY4 BUTTUM LOG_NEW COM_MODBUS_NEW
set PROJECT_PATH="%PROJECT_BASE%\%PROJECT_NAME%" set COMPILE="%COMPILER_PATH%\%COMPILER_NAME%" -C set LINK="%COMPILER_PATH%\%COMPILER_NAME%" @setlocal EnableDelayedExpansion @echo. @echo Compiling @echo --------- @for %%s in (%SOURCE_FILES%) do %COMPILE% -Q -MPLAB -%CPU%
-I%PROJECT_PATH% "%%s.c" -E"%%s.cce" -O"%%s.obj" @echo. @echo Linking @echo ======= @set OBJECT_FILES= @for %%s in (%SOURCE_FILES%) do @set OBJECT_FILES=!OBJECT_FILES! "%%s.obj" %LINK% %OBJECT_FILES% -Q -MPLAB -%CPU% -M"ikg6.map" -E"ikg6.lde"
-O"ikg6.cof" -O"ikg6.hex" @echo Done.