I thank you all for your responses.
I have resolved my original problem. Now I am happily compiling using modular feature and make the best of it.
x:\>sdcc -c sys.c
x:\>sdcc mainapp.c sys.rel
TRICKS: (no problem so far)
======
I rewrited my "sys.h" so I could use it to generate both sys.rel and main application output.
The key point is declaring "extern" appropriately.
MAINAPP.C
=========
#include "mcutype.c"
#include "sys.h"
...<snip>
/* EOL - MAINAPP.C */
SYS.C
=====
#ifndef SYS_C
#define SYS_C
#include "mcutype.h"
#include "sys.h"
...<snip>
#endif /* SYS_C */
SYS.H
=====
#ifndef SYS_H
#define SYS_H
#ifdef SYS_C
void LoadDelay ( unsigned int ticks );
void Delay ( unsigned int ticks );
void InitMcu ( void );
volatile unsigned int vTICKS; // system ticks
volatile unsigned char vTIMEOUT; // system timeout flag
#else
extern void LoadDelay ( unsigned int ticks );
extern void Delay ( unsigned int ticks );
extern void InitMcu ( void );
extern volatile unsigned int vTICKS; // system ticks
extern volatile unsigned char vTIMEOUT; // system timeout flag
#endif /* SYS_C */
#endif /* SYS_H */
Regards,
Fahmy
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
