]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
Convert dynamically loadable drivers into statically linkable drivers and add them...
[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-name _$(subst -,_,$(*)) $<
49         @$(AS) -o $@ $(AFLAGS) $(*)-emd.s
50
51 %-joy.o: %.joy
52         @$(CO) -o $(*)-joy.s --code-name _$(subst -,_,$(*)) $<
53         @$(AS) -o $@ $(AFLAGS) $(*)-joy.s
54
55 %-tgi.o: %.tgi
56         @$(CO) -o $(*)-tgi.s --code-name _$(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_stddrv.o            \
107         kbhit.o                 \
108         lseek.o                 \
109         mul40.o                 \
110         open.o                  \
111         oserrlist.o             \
112         oserror.o               \
113         ostype.o                \
114         posixdirent.o           \
115         randomize.o             \
116         read.o                  \
117         revers.o                \
118         rwcommon.o              \
119         savevec.o               \
120         scroll.o                \
121         setcolor.o              \
122         siocall.o               \
123         syschdir.o              \
124         sysmkdir.o              \
125         sysremove.o             \
126         sysrmdir.o              \
127         systime.o               \
128         sysuname.o              \
129         tgi_colors.o            \
130         tgi_stddrv.o            \
131         toascii.o               \
132         tvtype.o                \
133         ucase_fn.o              \
134         wherex.o                \
135         wherey.o                \
136         write.o                 \
137         $(EMDS:.emd=-emd.o)     \
138         $(JOYS:.joy=-joy.o)     \
139         $(TGIS:.tgi=-tgi.o)
140
141
142 #--------------------------------------------------------------------------
143 # Drivers
144
145 EMDS = atari-130xe.emd
146
147 JOYS = atari-stdjoy.joy atari-multijoy.joy
148
149 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
150        atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
151        atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
152
153 #--------------------------------------------------------------------------
154 # Targets
155
156 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
157
158 ../runtime/zeropage.o:
159         $(MAKE) -C $(dir $@) $(notdir $@)
160
161 clean:
162         @$(RM) $(OBJS) \
163                $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
164                $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
165                $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
166
167 zap:    clean
168         @$(RM) $(EMDS) $(JOYS) $(TGIS)