]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
Ignore only top level directories.
[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         irq.o                   \
107         joy_stat_stddrv.o       \
108         joy_stddrv.o            \
109         kbhit.o                 \
110         lseek.o                 \
111         mul40.o                 \
112         open.o                  \
113         oserrlist.o             \
114         oserror.o               \
115         ostype.o                \
116         posixdirent.o           \
117         randomize.o             \
118         read.o                  \
119         revers.o                \
120         rwcommon.o              \
121         savevec.o               \
122         scroll.o                \
123         setcolor.o              \
124         siocall.o               \
125         syschdir.o              \
126         sysmkdir.o              \
127         sysremove.o             \
128         sysrmdir.o              \
129         systime.o               \
130         sysuname.o              \
131         tgi_colors.o            \
132         tgi_stat_stddrv.o       \
133         tgi_stddrv.o            \
134         toascii.o               \
135         tvtype.o                \
136         ucase_fn.o              \
137         wherex.o                \
138         wherey.o                \
139         write.o                 \
140         $(EMDS:.emd=-emd.o)     \
141         $(JOYS:.joy=-joy.o)     \
142         $(TGIS:.tgi=-tgi.o)
143
144
145 #--------------------------------------------------------------------------
146 # Drivers
147
148 EMDS = atari-130xe.emd
149
150 JOYS = atari-stdjoy.joy atari-multijoy.joy
151
152 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
153        atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
154        atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
155
156 #--------------------------------------------------------------------------
157 # Targets
158
159 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
160
161 ../runtime/zeropage.o:
162         $(MAKE) -C $(dir $@) $(notdir $@)
163
164 clean:
165         @$(RM) $(OBJS) \
166                $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
167                $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
168                $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
169
170 zap:    clean
171         @$(RM) $(EMDS) $(JOYS) $(TGIS)