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