]> git.sur5r.net Git - cc65/blob - libsrc/c16/Makefile
Use "override" when appending to CFLAGS, so this works even when CFLAGS is
[cc65] / libsrc / c16 / Makefile
1 #
2 # makefile for CC65 runtime library (C16)
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = c16
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. -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 %.ser:  %.o ../runtime/zeropage.o
36         @$(LD) -t module -o $@ $^
37
38 %.tgi:  %.o ../runtime/zeropage.o
39         @$(LD) -t module -o $@ $^
40
41 #--------------------------------------------------------------------------
42 # Object files
43
44 OBJS =  _scrsize.o      \
45         break.o         \
46         cgetc.o         \
47         clrscr.o        \
48         color.o         \
49         conio.o         \
50         cputc.o         \
51         crt0.o          \
52         get_tv.o        \
53         joy_stddrv.o    \
54         kbhit.o         \
55         kclose.o        \
56         kernal.o        \
57         mainargs.o      \
58         randomize.o     \
59         revers.o        \
60         systime.o       \
61         sysuname.o
62
63 #--------------------------------------------------------------------------
64 # Drivers
65
66 EMDS = c16-ram.emd
67
68 JOYS = c16-stdjoy.joy
69
70 SERS =
71
72 TGIS =
73
74 #--------------------------------------------------------------------------
75 # Targets
76
77 .PHONY: all clean zap
78
79 all:    $(OBJS) $(EMDS) $(JOYS) $(SERS) $(TGIS)
80
81 ../runtime/zeropage.o:
82         $(MAKE) -C $(dir $@) $(notdir $@)
83
84 clean:
85         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
86
87 zap:    clean
88         @$(RM) $(EMDS) $(JOYS) $(SERS) $(TGIS)
89