]> git.sur5r.net Git - cc65/blob - libsrc/nes/Makefile
NES TGI Update by Stefan Haubenthal.
[cc65] / libsrc / nes / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = nes
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) -o $@ -t module $^
31
32 %.joy:  %.o ../runtime/zeropage.o
33         @$(LD) -o $@ -t module $^
34
35 %.mou:  %.o ../runtime/zeropage.o
36         @$(LD) -o $@ -t module $^
37
38 %.ser:  %.o ../runtime/zeropage.o
39         @$(LD) -o $@ -t module $^
40
41 %.tgi:  %.o ../runtime/zeropage.o
42         @$(LD) -o $@ -t module $^
43
44 #--------------------------------------------------------------------------
45 # Object files
46
47 OBJS =  _scrsize.o      \
48         cclear.o        \
49         chline.o        \
50         clock.o         \
51         clrscr.o        \
52         color.o         \
53         cputc.o         \
54         crt0.o          \
55         ctype.o         \
56         cvline.o        \
57         get_tv.o        \
58         gotox.o         \
59         gotoxy.o        \
60         gotoy.o         \
61         mainargs.o      \
62         ppu.o           \
63         ppubuf.o        \
64         randomize.o     \
65         revers.o        \
66         setcursor.o     \
67         sysuname.o      \
68         tgi_colors.o    \
69         waitvblank.o    \
70         wherex.o        \
71         wherey.o
72
73 #--------------------------------------------------------------------------
74 # Drivers
75
76 EMDS =
77
78 JOYS = nes-stdjoy.joy
79
80 MOUS =
81
82 SERS =
83
84 TGIS = nes-64-56-2.tgi
85
86 #--------------------------------------------------------------------------
87 # Targets
88
89 .PHONY: all clean zap
90
91 all:    $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
92
93 ../runtime/popa.o:
94         $(MAKE) -C $(dir $@) $(notdir $@)
95
96 ../runtime/zeropage.o:
97         $(MAKE) -C $(dir $@) $(notdir $@)
98
99 nes-64-56-2.tgi:        nes-64-56-2.o           \
100                         ../runtime/popa.o       \
101                         ../runtime/zeropage.o   \
102                         clrscr.o                \
103                         cputc.o                 \
104                         get_tv.o                \
105                         gotoxy.o                \
106                         ppu.o                   \
107                         ppubuf.o                \
108                         setcursor.o
109         @$(LD) -o $@ -t module $^
110
111 clean:
112         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
113
114 zap:    clean
115         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
116
117
118