]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
Removed underlines from structure names.
[cc65] / src / ld65 / make / gcc.mak
1 #
2 # gcc Makefile for ld65
3 #
4
5 # Library dir
6 COMMON  = ../common
7
8 # Default for the compiler lib search path as compiler define
9 CDEFS=-DCC65_LIB=\"/usr/lib/cc65/lib/\"
10 CFLAGS = -g -O2 -Wall -I$(COMMON) $(CDEFS)
11 CC=gcc
12 LDFLAGS=
13
14 # Perl script for config file conversion
15 CVT=cfg/cvt-cfg.pl
16
17 # -----------------------------------------------------------------------------
18 # List of all object files
19
20 OBJS =  bin.o           \
21         binfmt.o        \
22         config.o        \
23         dbgsyms.o       \
24         error.o         \
25         exports.o       \
26         expr.o          \
27         extsyms.o       \
28         fileio.o        \
29         fragment.o      \
30         global.o        \
31         library.o       \
32         main.o          \
33         mapfile.o       \
34         o65.o           \
35         objdata.o       \
36         objfile.o       \
37         scanner.o       \
38         segments.o      \
39         tgtcfg.o
40
41 # -----------------------------------------------------------------------------
42 # List of all config includes
43
44 INCS =  apple2.inc      \
45         atari.inc       \
46         c64.inc         \
47         c128.inc        \
48         cbm610.inc      \
49         geos.inc        \
50         none.inc        \
51         pet.inc         \
52         plus4.inc
53
54 # -----------------------------------------------------------------------------
55 #
56
57 LIBS = $(COMMON)/common.a
58
59
60 EXECS = ld65
61
62 .PHONY: all
63 ifeq (.depend,$(wildcard .depend))
64 all : $(EXECS)
65 include .depend
66 else
67 all:    depend
68         @$(MAKE) -f make/gcc.mak all
69 endif
70
71
72
73 ld65:   $(INCS) $(OBJS) $(LIBS)
74         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
75
76 clean:
77         rm -f *~ core *.map
78
79 zap:    clean
80         rm -f *.o $(INCS) $(EXECS) .depend
81
82
83 # ------------------------------------------------------------------------------
84 # Make the dependencies
85
86 .PHONY: depend dep
87 depend dep:     $(OBJS:.o=.c)
88         @echo "Creating dependency information"
89         $(CC) -I$(COMMON) -MM -MG $^ > .depend
90
91 # -----------------------------------------------------------------------------
92 # Rules to make config includes
93
94 apple2.inc:     cfg/apple2.cfg
95         @$(CVT) $< $@ CfgApple2
96
97 atari.inc:      cfg/atari.cfg
98         @$(CVT) $< $@ CfgAtari
99
100 c64.inc:        cfg/c64.cfg
101         @$(CVT) $< $@ CfgC64
102
103 c128.inc:       cfg/c128.cfg
104         @$(CVT) $< $@ CfgC128
105
106 cbm610.inc:     cfg/cbm610.cfg
107         @$(CVT) $< $@ CfgCBM610
108
109 geos.inc:       cfg/geos.cfg
110         @$(CVT) $< $@ CfgGeos
111
112 none.inc:       cfg/none.cfg
113         @$(CVT) $< $@ CfgNone
114
115 pet.inc:        cfg/pet.cfg
116         @$(CVT) $< $@ CfgPET
117
118 plus4.inc:      cfg/plus4.cfg
119         @$(CVT) $< $@ CfgPlus4
120
121