]> git.sur5r.net Git - cc65/blob - libsrc/atari/Makefile
Add definitions for tools so the makefile is useful by itself.
[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 "D:"
11 #                  as a default device
12 #                  needs UCASE_FILENAME to be defined, otherwise no effect
13
14 ATARIDEFS = -DNUMDRVS=4 -DUCASE_FILENAME=1 -DDEFAULT_DEVICE=1 -DLINEBUF=80
15
16 .SUFFIXES: .o .s .c
17
18 #--------------------------------------------------------------------------
19 # Programs and flags
20
21 SYS     = atari
22
23 AS      = ../../src/ca65/ca65
24 CC      = ../../src/cc65/cc65
25 LD      = ../../src/ld65/ld65
26
27 AFLAGS  = -t $(SYS) -I../../asminc
28 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
29
30 #--------------------------------------------------------------------------
31 # Rules
32
33 %.o:    %.c
34         @$(CC) $(CFLAGS) $(ATARIDEFS) $<
35         @$(AS) -o $@ $(AFLAGS) $(*).s
36
37 %.o:    %.s
38         @$(AS) -g -o $@ $(AFLAGS) $(ATARIDEFS) $<
39
40 %.emd:  %.o ../runtime/zeropage.o
41         @$(LD) -t module -o $@ $^
42
43 %.joy:  %.o ../runtime/zeropage.o
44         @$(LD) -t module -o $@ $^
45
46 %.tgi:  %.o ../runtime/zeropage.o
47         @$(LD) -t module -o $@ $^
48
49 #--------------------------------------------------------------------------
50 # Object files
51
52 OBJS =  _scrsize.o      \
53         break.o         \
54         cclear.o        \
55         cgetc.o         \
56         chline.o        \
57         clock.o         \
58         close.o         \
59         clrscr.o        \
60         color.o         \
61         cputc.o         \
62         crt0.o          \
63         ctype.o         \
64         cvline.o        \
65         dio_cts.o       \
66         dio_stc.o       \
67         diopncls.o      \
68         dioread.o       \
69         diowrite.o      \
70         diowritev.o     \
71         dosdetect.o     \
72         fdtable.o       \
73         getargs.o       \
74         getdefdev.o     \
75         getfd.o         \
76         gotox.o         \
77         gotoy.o         \
78         gotoxy.o        \
79         graphics.o      \
80         graphuse.o      \
81         joy_stddrv.o    \
82         kbhit.o         \
83         lseek.o         \
84         mouse.o         \
85         mul40.o         \
86         open.o          \
87         oserrlist.o     \
88         oserror.o       \
89         ostype.o        \
90         randomize.o     \
91         read.o          \
92         revers.o        \
93         rs232.o         \
94         rwcommon.o      \
95         savevec.o       \
96         scroll.o        \
97         setcolor.o      \
98         siocall.o       \
99         sysremove.o     \
100         systime.o       \
101         tvtype.o        \
102         sysuname.o      \
103         ucase_fn.o      \
104         wherex.o        \
105         wherey.o        \
106         write.o
107
108
109 #--------------------------------------------------------------------------
110 # Drivers
111
112 EMDS =
113
114 JOYS = atari-stdjoy.joy
115
116 TGIS =
117
118 #--------------------------------------------------------------------------
119 # Targets
120
121 all:    $(OBJS) $(EMDS) $(JOYS) $(TGIS)
122
123 ../runtime/zeropage.o:
124         $(MAKE) -C $(dir $@) $(notdir $@)
125
126 clean:
127         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(TGIS:.tgi=.o)
128
129 zap:    clean
130         @$(RM) $(EMDS) $(JOYS) $(TGIS)
131