Make

Modified on 2019/04/10 03:40 by Tom Wilson — Categorized as: File Management, Program Management

Make

Attachment: GetFile.aspx?Page=MMBasic.Make&File=make.zip

Make allows you to combine several source files into one, large BAS program.

This serves two purposes:


Instructions

There are three control arrays in MAKE.


Let's add a third platform named "Microboard"; this will be a text-only version for headless microcontroller boards.

First, change Platform.Count to 3.

Add a new Platform and Target:

Platform(3)="Microboard"
Target(3)="MyProgMb.bas"


Now move down to the Sources section and add a new source:
'Microboard sources
Source(2,1)="MyProg Intro.bas"
Source(2,2)="MyProg UI Mboard.bas"
Source(2,3)="MyProg Main.bas"

Finally, you'll want to split out your code across these files. UI and platform dependent code would go in "MyProg UI {platform}.bas". Use "MyProg Intro.bas" for your Copyright notice and variable declarations, and use "MyProg Main.bas" for the main body of your program. Notice that only the second filename is different, so this is the only one you will modify when porting your program to an additional platform.

Future Plans

I will probably smarten this up a little bit more, for example to template filenames and make it faster and easier to add additional files. I may also add #if and #include directives.

License

Use this as you wish. No rights or restrictions are reserved. I ask only that you keep the original attribution at the top of the program.