]> git.sur5r.net Git - cc65/blob - libsrc/atmos/Makefile
Add definitions for tools so the makefile is useful by itself.
[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) -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         getenv.o        \
59         gotox.o         \
60         gotoxy.o        \
61         gotoy.o         \
62         kbhit.o         \
63         mainargs.o      \
64         oserrlist.o     \
65         revers.o        \
66         systime.o       \
67         sysuname.o      \
68         wherex.o        \
69         wherey.o        \
70         write.o
71
72 #--------------------------------------------------------------------------
73 # Drivers
74
75 EMDS =
76
77 JOYS =
78
79 MOUS =
80
81 SERS =
82
83 TGIS = atmos-240-200-2.tgi
84
85 #--------------------------------------------------------------------------
86 # Targets
87
88 .PHONY: all clean zap
89
90 all:    $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
91
92 ../runtime/zeropage.o:
93         $(MAKE) -C $(dir $@) $(notdir $@)
94
95 clean:
96         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
97
98 zap:    clean
99         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
100
101