]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
The spans do now contain the size of a span, no longer the end offset.
[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 LD      = ../../src/ld65/ld65
32
33 AFLAGS  = -t $(SYS) --forget-inc-paths -I../../asminc
34 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
35
36 #--------------------------------------------------------------------------
37 # Rules
38
39 %.o:    %.c
40         @$(CC) $(CFLAGS) $(ATARIDEFS) $<
41         @$(AS) -o $@ $(AFLAGS) $(*).s
42
43 %.o:    %.s
44         @$(AS) -g -o $@ $(AFLAGS) $(ATARIDEFS) $<
45
46 %.emd:  %.o ../runtime/zeropage.o
47         @$(LD) -o $@ -t module $^
48
49 %.joy:  %.o ../runtime/zeropage.o
50         @$(LD) -o $@ -t module $^
51
52 %.tgi:  %.o ../runtime/zeropage.o atari_tgi_common.inc
53         @$(LD) -o $@ -t module $< ../runtime/zeropage.o
54
55
56 #--------------------------------------------------------------------------
57 # Object files
58
59 OBJS =  _scrsize.o      \
60         break.o         \
61         cclear.o        \
62         cgetc.o         \
63         chline.o        \
64         clock.o         \
65         close.o         \
66         clrscr.o        \
67         color.o         \
68         cputc.o         \
69         crt0.o          \
70         ctype.o         \
71         cvline.o        \
72         dio_cts.o       \
73         dio_stc.o       \
74         diopncls.o      \
75         dioqsize.o      \
76         dioread.o       \
77         diowrite.o      \
78         diowritev.o     \
79         do_oserr.o      \
80         dosdetect.o     \
81         fdtable.o       \
82         fdtab.o         \
83         fdtoiocb.o      \
84         getargs.o       \
85         getdefdev.o     \
86         getfd.o         \
87         gotox.o         \
88         gotoy.o         \
89         gotoxy.o        \
90         graphics.o      \
91         initcwd.o       \
92         inviocb.o       \
93         joy_stddrv.o    \
94         kbhit.o         \
95         lseek.o         \
96         mul40.o         \
97         open.o          \
98         oserrlist.o     \
99         oserror.o       \
100         ostype.o        \
101         posixdirent.o   \
102         randomize.o     \
103         read.o          \
104         revers.o        \
105         rwcommon.o      \
106         savevec.o       \
107         scroll.o        \
108         setcolor.o      \
109         siocall.o       \
110         syschdir.o      \
111         sysmkdir.o      \
112         sysremove.o     \
113         sysrmdir.o      \
114         systime.o       \
115         sysuname.o      \
116         tgi_colors.o    \
117         tgi_stddrv.o    \
118         toascii.o       \
119         tvtype.o        \
120         ucase_fn.o      \
121         wherex.o        \
122         wherey.o        \
123         write.o
124
125
126 #--------------------------------------------------------------------------
127 # Drivers
128
129 EMDS =
130
131 JOYS = atari-stdjoy.joy atari-multijoy.joy
132
133 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
134        atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
135        atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
136
137 #--------------------------------------------------------------------------
138 # Targets
139
140 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
141
142 ../runtime/zeropage.o:
143         $(MAKE) -C $(dir $@) $(notdir $@)
144
145 clean:
146         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(TGIS:.tgi=.o)
147
148 zap:    clean
149         @$(RM) $(EMDS) $(JOYS) $(TGIS)
150