]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
Used __attribute ((unused)) instead of -Wno-unused-parameter
[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 -W -I$(COMMON) $(CDEFS)
11 CC=gcc
12 EBIND=emxbind
13 LDFLAGS=
14
15 # Perl script for config file conversion
16 CVT=cfg/cvt-cfg.pl
17
18 # -----------------------------------------------------------------------------
19 # List of all object files
20
21 OBJS =  bin.o           \
22         binfmt.o        \
23         condes.o        \
24         config.o        \
25         dbginfo.o       \
26         dbgsyms.o       \
27         error.o         \
28         exports.o       \
29         expr.o          \
30         extsyms.o       \
31         fileinfo.o      \
32         fileio.o        \
33         fragment.o      \
34         global.o        \
35         library.o       \
36         lineinfo.o      \
37         main.o          \
38         mapfile.o       \
39         o65.o           \
40         objdata.o       \
41         objfile.o       \
42         scanner.o       \
43         segments.o      \
44         tgtcfg.o
45
46 # -----------------------------------------------------------------------------
47 # List of all config includes
48
49 INCS =  apple2.inc      \
50         atari.inc       \
51         bbc.inc         \
52         c64.inc         \
53         c128.inc        \
54         cbm510.inc      \
55         cbm610.inc      \
56         geos.inc        \
57         none.inc        \
58         pet.inc         \
59         plus4.inc
60
61 # -----------------------------------------------------------------------------
62 #
63
64 LIBS = $(COMMON)/common.a
65
66
67 EXECS = ld65
68
69 .PHONY: all
70 ifeq (.depend,$(wildcard .depend))
71 all : $(EXECS)
72 include .depend
73 else
74 all:    depend
75         @$(MAKE) -f make/gcc.mak all
76 endif
77
78
79
80 ld65:   $(INCS) $(OBJS) $(LIBS)
81         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
82         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
83
84 inc:    $(INCS)
85
86 clean:
87         rm -f *~ core *.map
88
89 zap:    clean
90         rm -f *.o $(INCS) $(EXECS) .depend
91
92
93 # ------------------------------------------------------------------------------
94 # Make the dependencies
95
96 .PHONY: depend dep
97 depend dep:     $(OBJS:.o=.c)
98         @echo "Creating dependency information"
99         $(CC) -I$(COMMON) -MM -MG $^ > .depend
100
101 # -----------------------------------------------------------------------------
102 # Rules to make config includes
103
104 apple2.inc:     cfg/apple2.cfg
105         @$(CVT) $< $@ CfgApple2
106
107 atari.inc:      cfg/atari.cfg
108         @$(CVT) $< $@ CfgAtari
109
110 bbc.inc:        cfg/bbc.cfg
111         @$(CVT) $< $@ CfgBBC
112
113 c64.inc:        cfg/c64.cfg
114         @$(CVT) $< $@ CfgC64
115
116 c128.inc:       cfg/c128.cfg
117         @$(CVT) $< $@ CfgC128
118
119 cbm510.inc:     cfg/cbm510.cfg
120         @$(CVT) $< $@ CfgCBM510
121
122 cbm610.inc:     cfg/cbm610.cfg
123         @$(CVT) $< $@ CfgCBM610
124
125 geos.inc:       cfg/geos.cfg
126         @$(CVT) $< $@ CfgGeos
127
128 none.inc:       cfg/none.cfg
129         @$(CVT) $< $@ CfgNone
130
131 pet.inc:        cfg/pet.cfg
132         @$(CVT) $< $@ CfgPET
133
134 plus4.inc:      cfg/plus4.cfg
135         @$(CVT) $< $@ CfgPlus4
136
137