]> git.sur5r.net Git - cc65/blob - libsrc/atmos/Makefile
fb2376b4e33f6790ce50dc0d545ac7b6b903f205
[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 LD      = ../../src/ld65/ld65
15
16 AFLAGS  = -t $(SYS) --forget-inc-paths -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 %.mou:  %.o ../runtime/zeropage.o
36         @$(LD) -t module -o $@ $^
37
38 %.ser:  %.o ../runtime/zeropage.o
39         @$(LD) -t module -o $@ $^
40
41 %.tgi:  %.o ../runtime/zeropage.o
42         @$(LD) -t module -o $@ $^
43
44 #--------------------------------------------------------------------------
45 # Object files
46
47 OBJS  = _scrsize.o      \
48         cclear.o        \
49         cgetc.o         \
50         chline.o        \
51         clock.o         \
52         clrscr.o        \
53         color.o         \
54         cputc.o         \
55         crt0.o          \
56         ctype.o         \
57         cvline.o        \
58         gotox.o         \
59         gotoxy.o        \
60         gotoy.o         \
61         kbhit.o         \
62         mainargs.o      \
63         oserrlist.o     \
64         revers.o        \
65         systime.o       \
66         sysuname.o      \
67         wherex.o        \
68         wherey.o        \
69         write.o
70
71 #--------------------------------------------------------------------------
72 # Drivers
73
74 EMDS =
75
76 JOYS =
77
78 MOUS =
79
80 SERS =
81
82 TGIS = atmos-240-200-2.tgi
83
84 #--------------------------------------------------------------------------
85 # Targets
86
87 .PHONY: all clean zap
88
89 all:    $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
90
91 ../runtime/zeropage.o:
92         $(MAKE) -C $(dir $@) $(notdir $@)
93
94 clean:
95         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
96
97 zap:    clean
98         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
99
100