-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.n88
62 lines (53 loc) · 1.39 KB
/
Makefile.n88
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Used for making fixed executable binaries.
# make -f Makefile.n88 PROJECT=examples/detectpc
# Please use official GNU make installer 3.81!
# i.e. do not use the one distributed with SGDK etc.
CC=sdcc
LD=sdldz80
AS=sdasz80
CFLAGS=-Isrc -Isrc/lib
OPTIMIZE=0
ifeq ($(OPTIMIZE), 1)
CMDFLAGS=--cyclomatic --max-allocs-per-node100000 --opt-code-speed
else
CMDFLAGS=#--cyclomatic --max-allocs-per-node2000 --fomit-frame-pointer
endif
PY=python3 -B
DEL=rm -rf
## PROJECT FOLDER ##
PROJECT=examples/helloworld
# This can also be explicit on the commandline i.e.
# $ make PROJECT=myproj
## MEMORY LOCATIONS ##
# stack grows downward, data grows upward. Should be the same value.
#default: STACK=0xbfff
default: DATA=0xe000
default: CODE=0xe100
# Stack should stay in ZP.
# This is due to VRAM being in C000~.
88FLAGS=-mz80 \
--code-loc $(CODE) --data-loc $(DATA)\
--no-std-crt0\
#--fomit-frame-pointer
## DISC FILE NAME ##
APPNAME=app.d88
default: clean $(PROJECT)
rm -f app.d88
$(PY) tools/maked88.py $(APPNAME)
$(CC) $(88FLAGS) $(CFLAGS) $(CMDFLAGS) $(PROJECT)/main.c -o out/main.ihx
$(PY) tools/hex2bin.py out/main.ihx main.bin
$(PY) tools/maked88.py $(APPNAME) main.bin -b 0x48 BINARY 0xe100
clean:
@$(DEL) out
@$(DEL) $(APPNAME)
@$(DEL) *.ihx
@$(DEL) *.lk
@$(DEL) *.lst
@$(DEL) *.map
@$(DEL) *.noi
@$(DEL) *.rel
@$(DEL) *.sym
@$(DEL) *.bin
@$(DEL) *.asm
@mkdir out
@echo Directories cleaned.