]> git.sur5r.net Git - cc65/blob - libsrc/apple2/Makefile
Update from Oliver Schmidt: Includes gotox/gotoy which were missing before.
[cc65] / libsrc / apple2 / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = apple2
11
12 AS      = ../../src/ca65/ca65
13 CC      = ../../src/cc65/cc65
14 LD      = ../../src/ld65/ld65
15
16 AFLAGS  = -t $(SYS) -I../../asminc
17 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
18
19 #--------------------------------------------------------------------------
20 # Rules
21
22 %.o:    %.c
23         @$(CC) $(CFLAGS) $<
24         @$(AS) -o $@ $(AFLAGS) $(*).s
25
26 %.o:    %.s
27         @$(AS) -g -o $@ $(AFLAGS) $<
28
29 %.emd:  %.o ../runtime/zeropage.o
30         @$(LD) -t module -o $@ $^
31
32 %.joy:  %.o ../runtime/zeropage.o
33         @$(LD) -t module -o $@ $^
34
35 %.tgi:  %.o ../runtime/zeropage.o
36         @$(LD) -t module -o $@ $^
37
38 #--------------------------------------------------------------------------
39 # Object files
40
41 OBJS=   _scrsize.o      \
42         break.o         \
43         cclear.o        \
44         cgetc.o         \
45         chline.o        \
46         clrscr.o        \
47         color.o         \
48         cputc.o         \
49         crt0.o          \
50         ctype.o         \
51         cvline.o        \
52         dioclose.o      \
53         diocommon.o     \
54         dioopen.o       \
55         dioread.o       \
56         diosectcount.o  \
57         diosectsize.o   \
58         diowrite.o      \
59         dosdetect.o     \
60         get_ostype.o    \
61         getenv.o        \
62         gotoxy.o        \
63         gotoy.o         \
64         joy_stddrv.o    \
65         kbhit.o         \
66         mainargs.o      \
67         mli.o           \
68         oserrlist.o     \
69         randomize.o     \
70         rcout.o         \
71         read.o          \
72         revers.o        \
73         rhome.o         \
74         rom.o           \
75         rpread.o        \
76         rrdkey.o        \
77         rvtabz.o        \
78         systime.o       \
79         sysuname.o      \
80         tgi_mode_table.o\
81         wherex.o        \
82         wherey.o        \
83         write.o
84
85 #--------------------------------------------------------------------------
86 # Drivers
87
88 EMDS = apple2-lc.emd
89
90 JOYS = apple2-stdjoy.joy
91
92 SERS =
93
94 TGIS = apple2-40-40-16.tgi apple2-280-192-6.tgi
95
96 #--------------------------------------------------------------------------
97 # Targets
98
99 .PHONY: all clean zap
100
101 all:    $(OBJS) $(EMDS) $(JOYS) $(SERS) $(TGIS)
102
103 ../runtime/zeropage.o:
104         $(MAKE) -C $(dir $@) $(notdir $@)
105
106 clean:
107         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
108
109 zap:    clean
110         @$(RM) $(EMDS) $(JOYS) $(SERS) $(TGIS)
111