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