]> git.sur5r.net Git - cc65/blob - libsrc/apple2enh/Makefile
Add definitions for tools so the makefile is useful by itself.
[cc65] / libsrc / apple2enh / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = apple2enh
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 %.tgi:  %.o ../runtime/zeropage.o
36         @$(LD) -t module -o $@ $^
37
38 #--------------------------------------------------------------------------
39 # Object files
40
41 OBJS=   _scrsize.o      \
42         chline.o        \
43         cputc.o         \
44         cvline.o        \
45         textframe.o
46
47 #--------------------------------------------------------------------------
48 # Drivers
49
50 EMDS =
51
52 JOYS =
53
54 SERS =
55
56 TGIS =
57
58 #--------------------------------------------------------------------------
59 # Targets
60
61 .PHONY: all clean zap
62
63 all:    $(OBJS) $(EMDS) $(JOYS) $(SERS) $(TGIS)
64
65 ../runtime/zeropage.o:
66         $(MAKE) -C $(dir $@) $(notdir $@)
67
68 clean:
69         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
70
71 zap:    clean
72         @$(RM) $(EMDS) $(JOYS) $(SERS) $(TGIS)
73
74