Create a file called project.cmd(name is not important);
--CHIP=18F4431
--ERRFORMAT="%f(%l) : error %n: %s"
--WARNFORMAT="%f(%l) : warning %n: %s (%a)"
--MSGFORMAT="%f(%l) : message %n: %s"
--OPT=speed
--TIME
-Q
--WARN=-9
--ASMLIST
--OUTPUT=mcof
--IDE=MPLAB
--ERRORS=10
--CALLGRAPH=full
--ECHO
-M5_0_0_slave_debug.map
-N100
-X
-DFOSC=40000000UL
-DGLOBAL_DEBUG=1
-DVERSION_NUMBER=800
-O"Debug\project.hex"
--OBJDIR="obj\slave\debug\8_0_0"
-I"..\..\..\source\drv\PIC18F4431"
-I"..\..\..\source\sys\PIC18F4431"
-I"..\..\..\source\err"
-I"..\..\..\source\std"
-I"..\..\..\source\app\2009\adv\slave"
-I"src"
..\..\..\source\app\2009\adv\slave\AppBrake.c
..\..\..\source\app\2009\adv\slave\AppMain.c
..\..\..\source\app\2009\adv\slave\AppMotor.c
..\..\..\source\app\2009\adv\slave\AppIsr.c
..\..\..\source\app\2009\adv\slave\AppAdc.c
..\..\..\source\app\2009\adv\slave\AppSpi.c
..\..\..\source\drv\PIC18F4431\DrvAdc.c
..\..\..\source\drv\PIC18F4431\DrvQei.c
..\..\..\source\drv\PIC18F4431\DrvPwm.c
..\..\..\source\drv\PIC18F4431\DrvTimer.c
..\..\..\source\drv\PIC18F4431\DrvEusart.c
..\..\..\source\drv\PIC18F4431\DrvGpio.c
..\..\..\source\drv\PIC18F4431\DrvSsp.c
..\..\..\source\drv\PIC18F4431\DrvCcp.c
..\..\..\source\std\Controller\StdPi.c
Configure PIC used:
--CHIP=18F4431
Configure messages to be understood by Visual Studio and to be displayed in standard output.
--ERRFORMAT="%f(%l) : error %n: %s"
--WARNFORMAT="%f(%l) : warning %n: %s (%a)"
--MSGFORMAT="%f(%l) : message %n: %s"
Compile optimize for speed:
--OPT=speed
In output display total time it took for compiling the project
--TIME
Warning level
--WARN=-9
Forgot these, but can be found on user manual of compiler
--ASMLIST
--OUTPUT=mcof
This will output files compatible with MPLAB and PROTEUS.
Useful for simulation.
--IDE=MPLAB
Stop compilation after this number of errors:
--ERRORS=10
--CALLGRAPH=full
--ECHO
Output MAP file:
-Mproject.map
This one tells compiler the maximum identifier length:
For example if you have a function called MyFunc(),this one has identifier length of 6 (1M 2y 3F 4u 5n 6c)
-N100
-X
Global defines:
These are similar to:
#define OSC 40000000UL
#define GLOBAL_DEBUG 1
#define VERSION_NUMBER 800
-DFOSC=40000000UL
-DGLOBAL_DEBUG=1
-DVERSION_NUMBER=800
Output HEX:
-O"Debug\project.hex"
Object files output folder:
--OBJDIR="obj\slave\debug\8_0_0"
Include folders(as you can see,these can be relative paths):
-I"..\..\..\source\drv\PIC18F4431"
-I"..\..\..\source\sys\PIC18F4431"
-I"..\..\..\source\err"
-I"..\..\..\source\std"
-I"..\..\..\source\app\2009\adv\slave"
-I"src"
These are project c files:
..\..\..\source\app\2009\adv\slave\AppBrake.c
..\..\..\source\app\2009\adv\slave\AppMain.c
..\..\..\source\app\2009\adv\slave\AppMotor.c
..\..\..\source\app\2009\adv\slave\AppIsr.c
..\..\..\source\app\2009\adv\slave\AppAdc.c
..\..\..\source\app\2009\adv\slave\AppSpi.c
..\..\..\source\drv\PIC18F4431\DrvAdc.c
..\..\..\source\drv\PIC18F4431\DrvQei.c
..\..\..\source\drv\PIC18F4431\DrvPwm.c
..\..\..\source\drv\PIC18F4431\DrvTimer.c
..\..\..\source\drv\PIC18F4431\DrvEusart.c
..\..\..\source\drv\PIC18F4431\DrvGpio.c
..\..\..\source\drv\PIC18F4431\DrvSsp.c
..\..\..\source\drv\PIC18F4431\DrvCcp.c
..\..\..\source\std\Controller\StdPi.c
After you configure this file you should tell VS:
PICC18.exe @project.cmdThis line you should provide it in configuration of your VS project.
Sadly on this PC I don't have VS installed to show you a screenshot, but I'msure you will find your way.
If there still is interest I'll provide it tomorrow.
Have fun!