]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
4e0b93013c6a70f8862487985d71fbc43e8628d5
[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
53         @$(LD) -t module -o $@ $^
54
55 #--------------------------------------------------------------------------
56 # Object files
57
58 OBJS =  _scrsize.o      \
59         break.o         \
60         cclear.o        \
61         cgetc.o         \
62         chline.o        \
63         clock.o         \
64         close.o         \
65         clrscr.o        \
66         color.o         \
67         cputc.o         \
68         crt0.o          \
69         ctype.o         \
70         cvline.o        \
71         dio_cts.o       \
72         dio_stc.o       \
73         diopncls.o      \
74         dioqsize.o      \
75         dioread.o       \
76         diowrite.o      \
77         diowritev.o     \
78         dosdetect.o     \
79         fdtable.o       \
80         getargs.o       \
81         getdefdev.o     \
82         getfd.o         \
83         gotox.o         \
84         gotoy.o         \
85         gotoxy.o        \
86         graphics.o      \
87         joy_stddrv.o    \
88         kbhit.o         \
89         lseek.o         \
90         mouse.o         \
91         mul40.o         \
92         open.o          \
93         oserrlist.o     \
94         oserror.o       \
95         ostype.o        \
96         randomize.o     \
97         read.o          \
98         revers.o        \
99         rs232.o         \
100         rwcommon.o      \
101         savevec.o       \
102         scroll.o        \
103         setcolor.o      \
104         siocall.o       \
105         sysmkdir.o      \
106         sysremove.o     \
107         sysrmdir.o      \
108         systime.o       \
109         sysuname.o      \
110         tvtype.o        \
111         ucase_fn.o      \
112         wherex.o        \
113         wherey.o        \
114         write.o
115
116
117 #--------------------------------------------------------------------------
118 # Drivers
119
120 EMDS =
121
122 JOYS = atari-stdjoy.joy atari-multijoy.joy
123
124 TGIS =
125
126 #--------------------------------------------------------------------------
127 # Targets
128
129 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
130
131 ../runtime/zeropage.o:
132         $(MAKE) -C $(dir $@) $(notdir $@)
133
134 clean:
135         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(TGIS:.tgi=.o)
136
137 zap:    clean
138         @$(RM) $(EMDS) $(JOYS) $(TGIS)
139