]> git.sur5r.net Git - cc65/blob - libsrc/nes/Makefile
don't use constructor to setup runtime stack
[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) -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         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         waitvblank.o    \
69         wherex.o        \
70         wherey.o
71
72 #--------------------------------------------------------------------------
73 # Drivers
74
75 EMDS =
76
77 JOYS = nes-stdjoy.joy
78
79 MOUS =
80
81 SERS =
82
83 TGIS =
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