-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.mak
63 lines (48 loc) · 1.67 KB
/
Makefile.mak
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
63
CC65_HOME=C:\\Users\\bradc\\AppData\\Roaming\\cc65\\bin
CC65=$(CC65_HOME)\\cc65.exe
CA65=$(CC65_HOME)\\ca65.exe
CL65=$(CC65_HOME)\\cl65.exe
PRODUCT=YAIL
TARGET=atari
SRC_DIR=src
#CFLAGS=-Osri
#CFLAGS=-Os -DYAIL_BUILD_FILE_LOADER
CFLAGS=-Os
LINKFLAGS=-D__SYSTEM_CHECK__=1
#LINKFLAGS=--debug-info -Wl --dbgfile,"myapp.dbg"
# -D__SYSTEM_CHECK__=1
LIBRARIES=fujinet-lib/fujinet-atari-2.2.1.lib
.SUFFIXES:
.SUFFIXES: .c .s .o
all: $(PRODUCT).XEX
c_files: $(SRC_DIR)\*.c
@echo Building $(**) to .s...
@$(MAKE) -nologo /f Makefile.mak $(**:.c=.s)
s_files: $(SRC_DIR)\*.s
@echo Building $(**) to .o...
@$(MAKE) -nologo /f Makefile.mak $(**:.s=.o)
link_files: $(SRC_DIR)\*.o
$(CL65) -t $(TARGET) $(CFLAGS) $(LINKFLAGS) -o $(PRODUCT).XEX --config $(SRC_DIR)\$(PRODUCT).$(TARGET)-xex.cfg --mapfile $(PRODUCT).map -Ln $(PRODUCT).lbl $(**) $(TARGET).lib $(LIBRARIES)
.s.o:
$(CA65) -t $(TARGET) $<
.c.s:
$(CC65) -t $(TARGET) $(CFLAGS) -I fujinet-lib/ $<
$(PRODUCT).XEX: c_files s_files link_files
clean: s_products c_products
del $(PRODUCT).XEX $(PRODUCT).map
c_products: $(SRC_DIR)\*.c
@echo Cleaning $(**:.c=.s)
del $(**:.c=.s)
s_products: $(SRC_DIR)\*.s
@echo Cleaning $(**:.s=.o)
del $(**:.s=.o)
atr: $(PRODUCT).XEX
copy DOS.SYS atr\\
copy $(PRODUCT).XEX atr\AUTORUN.SYS
disk: atr
@echo Building bootable disk
dir2atr -E -b Dos25 -P $(PRODUCT).ATR atr
#debug: disk
# Altirra64 /defprofile:xl /ntsc /burstio /fastboot /debug /debugbrkrun /debugcmd: ".loadsym $(PRODUCT).lbl" /disk $(PRODUCT).ATR
debug: $(PRODUCT).XEX
Altirra64 /defprofile:xl /ntsc /burstio /fastboot /debug /debugbrkrun /debugcmd: ".loadsym $(PRODUCT).lbl" $(PRODUCT).XEX