]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
move fdtoiocb function into its own file -- idea by Daniel Serpell
[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) -t module -o $@ $^
48
49 %.joy:  %.o ../runtime/zeropage.o
50         @$(LD) -t module -o $@ $^
51
52 %.tgi:  %.o ../runtime/zeropage.o atari_tgi_common.inc
53         @$(LD) -t module -o $@ $< ../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         dosdetect.o     \
80         fdtable.o       \
81         fdtoiocb.o      \
82         getargs.o       \
83         getdefdev.o     \
84         getfd.o         \
85         gotox.o         \
86         gotoy.o         \
87         gotoxy.o        \
88         graphics.o      \
89         joy_stddrv.o    \
90         kbhit.o         \
91         lseek.o         \
92         mouse.o         \
93         mul40.o         \
94         open.o          \
95         oserrlist.o     \
96         oserror.o       \
97         ostype.o        \
98         randomize.o     \
99         read.o          \
100         revers.o        \
101         rs232.o         \
102         rwcommon.o      \
103         savevec.o       \
104         scroll.o        \
105         setcolor.o      \
106         siocall.o       \
107         sysmkdir.o      \
108         sysremove.o     \
109         sysrmdir.o      \
110         systime.o       \
111         sysuname.o      \
112         toascii.o       \
113         tgi_mode_table.o\
114         tvtype.o        \
115         ucase_fn.o      \
116         wherex.o        \
117         wherey.o        \
118         write.o
119
120
121 #--------------------------------------------------------------------------
122 # Drivers
123
124 EMDS =
125
126 JOYS = atari-stdjoy.joy atari-multijoy.joy
127
128 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
129        atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
130        atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
131
132 #--------------------------------------------------------------------------
133 # Targets
134
135 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
136
137 ../runtime/zeropage.o:
138         $(MAKE) -C $(dir $@) $(notdir $@)
139
140 clean:
141         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(TGIS:.tgi=.o)
142
143 zap:    clean
144         @$(RM) $(EMDS) $(JOYS) $(TGIS)
145