]> git.sur5r.net Git - cc65/blob - libsrc/lynx/Makefile
Add definitions for tools so the makefile is useful by itself.
[cc65] / libsrc / lynx / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7
8 #--------------------------------------------------------------------------
9 # Programs and flags
10
11 SYS     = lynx
12
13 AS      = ../../src/ca65/ca65
14 CC      = ../../src/cc65/cc65
15 LD      = ../../src/ld65/ld65
16
17 AFLAGS  = -t $(SYS) -I../../asminc
18 CFLAGS  = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
19
20 #--------------------------------------------------------------------------
21 # Rules
22
23 %.o:    %.c
24         @$(CC) $(CFLAGS) $<
25         @$(AS) -o $@ $(AFLAGS) $(*).s
26
27 %.o:    %.s
28         @$(AS) -g -o $@ $(AFLAGS) $<
29
30 %.emd:  %.o ../runtime/zeropage.o
31         @$(LD) -t module -o $@ $^
32
33 %.joy:  %.o ../runtime/zeropage.o
34         @$(LD) -t module -o $@ $^
35
36 %.mou:  %.o ../runtime/zeropage.o
37         @$(LD) -t module -o $@ $^
38
39 %.ser:  %.o ../runtime/zeropage.o
40         @$(LD) -t module -o $@ $^
41
42 %.tgi:  %.o ../runtime/zeropage.o
43         @$(LD) -t module -o $@ $^
44
45 #--------------------------------------------------------------------------
46 # Object files
47
48 OBJS =  crt0.o          \
49         ctype.o         \
50         eeprom.o        \
51         framerate.o     \
52         getenv.o        \
53         mainargs.o      \
54         sysuname.o      \
55         upload.o
56
57 #--------------------------------------------------------------------------
58 # Drivers
59
60 EMDS =
61
62 JOYS = lynx-stdjoy.joy
63
64 MOUS =
65
66 SERS =
67
68 TGIS = lynx-160-102-16.tgi
69
70 #--------------------------------------------------------------------------
71 # Targets
72
73 .PHONY: all clean zap
74
75 all:    $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
76
77 ../runtime/zeropage.o:
78         $(MAKE) -C $(dir $@) $(notdir $@)
79
80 clean:
81         @$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
82
83 zap:    clean
84         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
85