]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
Implement packed mode
[cc65] / libsrc / atari / Makefile
1 #
2 # makefile for CC65 Atari runtime library
3 #
4 # NUMDRVS - number of supported drives (max. 16)
5 #           4 bytes for each device are statically allocated
6 # LINEBUF - support line buffered reads from E: (the number specifies
7 #           the length of the buffer)
8 # UCASE_FILENAME - all filenames get uppercased
9 # DEFAULT_DEVICE - if the string passed to the uppercase function doesn't
10 #                  include a device (":" at position 2 or 3), provide "Dn:"
11 #                  as a default disk device
12 #                  n is the value of DEFAULT_DEVICE, unless DYNAMIC_DD is
13 #                  also set, in which case it's overridden by a runtime
14 #                  check (on SpartaDOS only)
15 #                  needs UCASE_FILENAME to be defined, otherwise no effect
16 # DYNAMIC_DD     - determine default disk device at runtime (SpartaDOS only)
17 #                  needs DEFAULT_DEVICE to be defined, otherwise no effect
18
19 ATARIDEFS =  -DNUMDRVS=4 -DUCASE_FILENAME=1 -DDEFAULT_DEVICE=1 -DLINEBUF=80
20 ATARIDEFS += -DDYNAMIC_DD=1
21
22 .SUFFIXES: .o .s .c
23
24 #--------------------------------------------------------------------------
25 # Programs and flags
26
27 SYS     = atari
28
29 AS      = ../../src/ca65/ca65
30 CC      = ../../src/cc65/cc65
31 CO      = ../../src/co65/co65
32 LD      = ../../src/ld65/ld65
33
34 AFLAGS  = -t $(SYS) --forget-inc-paths -I../../asminc
35 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
36
37 #--------------------------------------------------------------------------
38 # Rules
39
40 %.o:    %.c
41         @$(CC) $(CFLAGS) $(ATARIDEFS) $<
42         @$(AS) -o $@ $(AFLAGS) $(*).s
43
44 %.o:    %.s
45         @$(AS) -g -o $@ $(AFLAGS) $(ATARIDEFS) $<
46
47 %-emd.o: %.emd
48         @$(CO) -o $(*)-emd.s --code-label _$(subst -,_,$(*)) $<
49         @$(AS) -o $@ $(AFLAGS) $(*)-emd.s
50
51 %-joy.o: %.joy
52         @$(CO) -o $(*)-joy.s --code-label _$(subst -,_,$(*)) $<
53         @$(AS) -o $@ $(AFLAGS) $(*)-joy.s
54
55 %-tgi.o: %.tgi
56         @$(CO) -o $(*)-tgi.s --code-label _$(subst -,_,$(*)) $<
57         @$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
58
59 %.emd:  %.o ../runtime/zeropage.o
60         @$(LD) -o $@ -t module $^
61
62 %.joy:  %.o ../runtime/zeropage.o
63         @$(LD) -o $@ -t module $^
64
65 %.tgi:  %.o ../runtime/zeropage.o atari_tgi_common.inc
66         @$(LD) -o $@ -t module $< ../runtime/zeropage.o
67
68
69 #--------------------------------------------------------------------------
70 # Object files
71
72 OBJS =  _scrsize.o              \
73         break.o                 \
74         cclear.o                \
75         cgetc.o                 \
76         chline.o                \
77         clock.o                 \
78         close.o                 \
79         clrscr.o                \
80         color.o                 \
81         cputc.o                 \
82         crt0.o                  \
83         ctype.o                 \
84         cvline.o                \
85         dio_cts.o               \
86         dio_stc.o               \
87         diopncls.o              \
88         dioqsize.o              \
89         dioread.o               \
90         diowrite.o              \
91         diowritev.o             \
92         do_oserr.o              \
93         dosdetect.o             \
94         fdtable.o               \
95         fdtab.o                 \
96         fdtoiocb.o              \
97         getargs.o               \
98         getdefdev.o             \
99         getfd.o                 \
100         gotox.o                 \
101         gotoy.o                 \
102         gotoxy.o                \
103         graphics.o              \
104         initcwd.o               \
105         inviocb.o               \
106         joy_stat_stddrv.o       \
107         joy_stddrv.o            \
108         kbhit.o                 \
109         lseek.o                 \
110         mul40.o                 \
111         open.o                  \
112         oserrlist.o             \
113         oserror.o               \
114         ostype.o                \
115         posixdirent.o           \
116         randomize.o             \
117         read.o                  \
118         revers.o                \
119         rwcommon.o              \
120         savevec.o               \
121         scroll.o                \
122         setcolor.o              \
123         siocall.o               \
124         syschdir.o              \
125         sysmkdir.o              \
126         sysremove.o             \
127         sysrmdir.o              \
128         systime.o               \
129         sysuname.o              \
130         tgi_colors.o            \
131         tgi_stat_stddrv.o       \
132         tgi_stddrv.o            \
133         toascii.o               \
134         tvtype.o                \
135         ucase_fn.o              \
136         wherex.o                \
137         wherey.o                \
138         write.o                 \
139         $(EMDS:.emd=-emd.o)     \
140         $(JOYS:.joy=-joy.o)     \
141         $(TGIS:.tgi=-tgi.o)
142
143
144 #--------------------------------------------------------------------------
145 # Drivers
146
147 EMDS = atari-130xe.emd
148
149 JOYS = atari-stdjoy.joy atari-multijoy.joy
150
151 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
152        atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
153        atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
154
155 #--------------------------------------------------------------------------
156 # Targets
157
158 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
159
160 ../runtime/zeropage.o:
161         $(MAKE) -C $(dir $@) $(notdir $@)
162
163 clean:
164         @$(RM) $(OBJS) \
165                $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
166                $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
167                $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
168
169 zap:    clean
170         @$(RM) $(EMDS) $(JOYS) $(TGIS)