]> git.sur5r.net Git - cc65/blob - src/ca65/make/gcc.mak
9d8e782a94995d98dbde8ad6956597ee1279da67
[cc65] / src / ca65 / make / gcc.mak
1 #
2 # gcc Makefile for ca65
3 #
4
5 # ------------------------------------------------------------------------------
6
7 # The executable to build
8 EXE     = ca65
9
10 # Library dir
11 COMMON  = ../common
12
13 # Several search paths. You may redefine these on the command line
14 CA65_INC = \"/usr/lib/cc65/asminc/\"
15
16 #
17 CC      = gcc
18 CFLAGS  = -g -O2 -Wall -W -std=c89
19 override CFLAGS += -I$(COMMON)
20 override CFLAGS += -DCA65_INC=$(CA65_INC)
21 EBIND   = emxbind
22 LDFLAGS =
23
24 # Perl script for macro file conversion
25 CVT=macpack/cvt-mac.pl
26
27 # -----------------------------------------------------------------------------
28 # List of all object files
29
30 OBJS =  anonname.o      \
31         asserts.o       \
32         condasm.o       \
33         dbginfo.o       \
34         ea65.o          \
35         easw16.o        \
36         enum.o          \
37         error.o         \
38         expr.o          \
39         feature.o       \
40         filetab.o       \
41         fragment.o      \
42         global.o        \
43         incpath.o       \
44         instr.o         \
45         istack.o        \
46         lineinfo.o      \
47         listing.o       \
48         macpack.o       \
49         macro.o         \
50         main.o          \
51         nexttok.o       \
52         objcode.o       \
53         objfile.o       \
54         options.o       \
55         pseudo.o        \
56         repeat.o        \
57         scanner.o       \
58         segdef.o        \
59         segment.o       \
60         sizeof.o        \
61         span.o          \
62         spool.o         \
63         struct.o        \
64         studyexpr.o     \
65         symentry.o      \
66         symbol.o        \
67         symtab.o        \
68         token.o         \
69         toklist.o       \
70         ulabel.o
71
72 # -----------------------------------------------------------------------------
73 # List of all macro files
74
75 INCS =  atari.inc       \
76         cbm.inc         \
77         cpu.inc         \
78         generic.inc     \
79         longbranch.inc
80
81 LIBS = $(COMMON)/common.a
82
83 # ------------------------------------------------------------------------------
84 # Makefile targets
85
86 # Main target - must be first
87 .PHONY: all
88 ifeq (.depend,$(wildcard .depend))
89 all:    $(EXE)
90 include .depend
91 else
92 all:    depend
93         @$(MAKE) -f make/gcc.mak all
94 endif
95
96 $(EXE): $(INCS) $(OBJS) $(LIBS)
97         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
98         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
99
100 inc:    $(INCS)
101
102 clean:
103         $(RM) *~ core.* *.map
104
105 zap:    clean
106         $(RM) *.o $(EXE) $(INCS) .depend
107
108 # ------------------------------------------------------------------------------
109 # Make the dependencies
110
111 .PHONY: depend dep
112 depend dep:     $(INCS) $(OBJS:.o=.c)
113         @echo "Creating dependency information"
114         $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
115
116 # -----------------------------------------------------------------------------
117 # Rules to make config includes
118
119 atari.inc:      macpack/atari.mac
120         @$(CVT) $< $@ MacAtari
121
122 cbm.inc:        macpack/cbm.mac
123         @$(CVT) $< $@ MacCBM
124
125 cpu.inc:        macpack/cpu.mac
126         @$(CVT) $< $@ MacCPU
127
128 generic.inc:    macpack/generic.mac
129         @$(CVT) $< $@ MacGeneric
130
131 longbranch.inc: macpack/longbranch.mac
132         @$(CVT) $< $@ MacLongBranch
133
134
135
136
137
138
139
140
141
142