]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/Makefile
Ignore only top level directories.
[cc65] / libsrc / geos-common / Makefile
1 #
2 # makefile for CC65 runtime library
3 #
4
5 .SUFFIXES: .o .s .c
6
7 #--------------------------------------------------------------------------
8 # Programs and flags
9
10 SYS     = geos-cbm
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../$(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) -o $(notdir $(*).s) $(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 # Directories
46
47 DIRS =  common          \
48         conio           \
49         dlgbox          \
50         disk            \
51         file            \
52         graph           \
53         memory          \
54         menuicon        \
55         mousesprite     \
56         process         \
57         runtime         \
58         system
59
60 #--------------------------------------------------------------------------
61 # Drivers
62
63 EMDS =
64
65 JOYS =
66
67 MOUS = #geos-stdmou.mou
68
69 SERS =
70
71 TGIS =
72
73 #--------------------------------------------------------------------------
74 # Directives
75
76 include $(addsuffix /Makefile, $(DIRS))
77 vpath %.c $(DIRS)
78 vpath %.s $(DIRS)
79
80 #--------------------------------------------------------------------------
81 # Targets
82
83 .PHONY: all clean zap
84
85 all:    $(C_OBJS) $(S_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
86
87 ../runtime/zeropage.o:
88         $(MAKE) -C $(dir $@) $(notdir $@)
89         
90 clean:
91         @$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
92
93 zap:    clean
94         @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)