]> git.sur5r.net Git - cc65/blob - libsrc/atmos/Makefile
6aa68c1c351d2c815b607e3383e53aece0944b8c
[cc65] / libsrc / atmos / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = atmos
11
12 AS      = ../../src/ca65/ca65
13 CC      = ../../src/cc65/cc65
14 CO      = ../../src/co65/co65
15 LD      = ../../src/ld65/ld65
16
17 AFLAGS  = -t $(SYS) --forget-inc-paths -I../../asminc
18 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
19
20 #--------------------------------------------------------------------------
21 # Rules
22
23 %.o:    %.c
24         @$(CC) $(CFLAGS) $<
25         @$(AS) -o $@ $(AFLAGS) $(*).s
26
27 %.o:    %.s
28         @$(AS) -g -o $@ $(AFLAGS) $<
29
30 %-emd.o: %.emd
31         @$(CO) -o $(*)-emd.s --code-label _$(subst -,_,$(*)) $<
32         @$(AS) -o $@ $(AFLAGS) $(*)-emd.s
33
34 %-joy.o: %.joy
35         @$(CO) -o $(*)-joy.s --code-label _$(subst -,_,$(*)) $<
36         @$(AS) -o $@ $(AFLAGS) $(*)-joy.s
37
38 %-mou.o: %.mou
39         @$(CO) -o $(*)-mou.s --code-label _$(subst -,_,$(*)) $<
40         @$(AS) -o $@ $(AFLAGS) $(*)-mou.s
41
42 %-ser.o: %.ser
43         @$(CO) -o $(*)-ser.s --code-label _$(subst -,_,$(*)) $<
44         @$(AS) -o $@ $(AFLAGS) $(*)-ser.s
45
46 %-tgi.o: %.tgi
47         @$(CO) -o $(*)-tgi.s --code-label _$(subst -,_,$(*)) $<
48         @$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
49
50 %.emd:  %.o ../runtime/zeropage.o
51         @$(LD) -o $@ -t module $^
52
53 %.joy:  %.o ../runtime/zeropage.o
54         @$(LD) -o $@ -t module $^
55
56 %.mou:  %.o ../runtime/zeropage.o
57         @$(LD) -o $@ -t module $^
58
59 %.ser:  %.o ../runtime/zeropage.o
60         @$(LD) -o $@ -t module $^
61
62 %.tgi:  %.o ../runtime/zeropage.o
63         @$(LD) -o $@ -t module $^
64
65 #--------------------------------------------------------------------------
66 # Object files
67
68 OBJS  = _scrsize.o              \
69         atmos_load.o            \
70         atmos_save.o            \
71         cclear.o                \
72         cgetc.o                 \
73         chline.o                \
74         clock.o                 \
75         clrscr.o                \
76         color.o                 \
77         cputc.o                 \
78         crt0.o                  \
79         ctype.o                 \
80         cvline.o                \
81         gotox.o                 \
82         gotoxy.o                \
83         gotoy.o                 \
84         irq.o                   \
85         joy_stat_stddrv.o       \
86         joy_stddrv.o            \
87         kbhit.o                 \
88         mainargs.o              \
89         oserrlist.o             \
90         oserror.o               \
91         revers.o                \
92         store_filename.o        \
93         systime.o               \
94         sysuname.o              \
95         tgi_colors.o            \
96         tgi_stat_stddrv.o       \
97         tgi_stddrv.o            \
98         toascii.o               \
99         wherex.o                \
100         wherey.o                \
101         write.o                 \
102         $(EMDS:.emd=-emd.o)     \
103         $(JOYS:.joy=-joy.o)     \
104         $(MOUS:.mou=-mou.o)     \
105         $(SERS:.ser=-ser.o)     \
106         $(TGIS:.tgi=-tgi.o)
107
108
109 #--------------------------------------------------------------------------
110 # Drivers
111
112 EMDS =
113
114 JOYS = atmos-pase.joy
115
116 MOUS =
117
118 SERS = atmos-acia.ser
119
120 TGIS = atmos-240-200-2.tgi atmos-228-200-3.tgi
121
122 #--------------------------------------------------------------------------
123 # Targets
124
125 .PHONY: all clean zap
126
127 all:    $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
128
129 ../runtime/zeropage.o:
130         $(MAKE) -C $(dir $@) $(notdir $@)
131
132 clean:
133         @$(RM) $(OBJS) \
134                $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
135                $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
136                $(MOUS:.mou=.o) $(MOUS:.mou=-mou.s) \
137                $(SERS:.ser=.o) $(SERS:.ser=-ser.s) \
138                $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
139
140 zap:    clean
141         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)