-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bndbuild] Update the jinja example to use conditionnal build
- Loading branch information
Krusty/Benediction
committed
Jul 14, 2024
1 parent
fea3a00
commit dbe2487
Showing
2 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,38 @@ | ||
{% set source = "test.asm" %} | ||
#!/bndbuild | ||
# bndbuild -DCPCADDR=<myip> m4 if you want a specific address for the M4 | ||
# bndbuild -DASSEMBLER=rasm m4 if you want to assemble with rasm (needs to be on the PATH) instead of basm | ||
# bndbuild DASSEMBLER=rasm --dot | dot -Tpng | display if you want to see the dependency tree for rasm-based construction | ||
|
||
{%- if not CPCADDR -%} | ||
{%- set CPCADDR = "192.168.1.26" -%} | ||
{%- endif -%} | ||
{{ASSEMBLER}} | ||
|
||
{%- if not ASSEMBLER -%} | ||
{%- set ASSEMBLER = "basm" -%} | ||
{%- endif -%} | ||
{{ASSEMBLER}} | ||
|
||
{%- macro assemble(base) -%} | ||
{%- if ASSEMBLER == "rasm" -%} | ||
extern rasm {{base}} | ||
{%- elif ASSEMBLER == "basm" -%} | ||
basm {{base}} | ||
{%- else -%} | ||
{{- fail("wrong ASSEMBER value: " + ASSEMBLER) }} | ||
{%- endif -%} | ||
{%- endmacro -%} | ||
|
||
{%- set source = "test.asm" -%} | ||
{%- set prog = "TEST" %} | ||
|
||
- dep: {{source}} | ||
tgt: test.o | ||
cmd: basm {{source}} -o test.o | ||
tgt: {{prog}} | ||
cmd: {{assemble(source)}} | ||
|
||
- tgt: distclean | ||
cmd: -rm test.o | ||
cmd: -rm {{prog}} | ||
|
||
- dep: {{prog}} | ||
tgt: m4 | ||
cmd: xfer {{CPCADDR}} -y {{prog}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
org 0x100 | ||
jp $ | ||
org 0x1000 | ||
run $ | ||
beginning | ||
ld hl, data | ||
loop | ||
ld a, (hl) | ||
or a : jp z, $ | ||
call 0xbb5a | ||
inc hl | ||
jp loop | ||
|
||
data | ||
db "HELLO WORLD FROM " | ||
ifdef BASM | ||
db "basm" | ||
else | ||
db "rasm" | ||
endif | ||
db 0 | ||
|
||
save "TEST", beginning, $-beginning, AMSDOS |