So, basically, I want to have a single include file per source. The issue I am running into is when it comes to having import statements (as my source file will also export symbols.) My workaround I am thinking of is to include a define in the source file. Bear in mind the syntax is wrong. I am still wrangling to understand the way ca65's preprocessor does things:
In Source.s
Code: Select all
.define SOURCE_S
.include "source.inc"
.export foo
.export bar
Code: Select all
; standard include guard
.ifndef SOURCE_INC
.define SOURCE_INC
.ifndef SOURCE_S
.import foo
.import bar
.endif
; Structs and other preprocessor stuffs
blah
blah
blah
blah
.endif ; ifndef SOURCE_INC
I am also running a small misunderstanding of the syntax used for the .ifdef preprocessor directive. Currently, I am having to declare something in the following manner:
Code: Select all
_APPCONFIG_INC_ = 1
Code: Select all
.define _APPCONFIG_INC_