]> git.sur5r.net Git - cc65/blob - src/cc65/make/gcc.mak
Added the lineinfo module. Changed the complete code generation to use the
[cc65] / src / cc65 / make / gcc.mak
1 #
2 # Makefile for cross-compiler version of CC65.
3 #
4
5
6
7 # ------------------------------------------------------------------------------
8
9 # The executable to build
10 EXE     = cc65
11
12 # Library directories
13 COMMON  = ../common
14
15 # Default for the compiler lib search path as compiler define
16 CDEFS=-DCC65_INC=\"/usr/lib/cc65/include/\"
17 CFLAGS = -O2 -g -Wall -I$(COMMON) $(CDEFS)
18 CC=gcc
19 EBIND=emxbind
20 LDFLAGS=
21
22 # ------------------------------------------------------------------------------
23 # Object files and libraries to link
24
25 OBJS =  anonname.o      \
26         asmcode.o       \
27         asmlabel.o      \
28         codeent.o       \
29         codegen.o       \
30         codelab.o       \
31         codeinfo.o      \
32         codeopt.o       \
33         codeseg.o       \
34         compile.o       \
35         coptind.o       \
36         cpu.o           \
37         dataseg.o       \
38         datatype.o      \
39         declare.o       \
40         declattr.o      \
41         error.o         \
42         expr.o          \
43         exprheap.o      \
44         exprnode.o      \
45         funcdesc.o      \
46         function.o      \
47         global.o        \
48         goto.o          \
49         ident.o         \
50         incpath.o       \
51         input.o         \
52         lineinfo.o      \
53         litpool.o       \
54         locals.o        \
55         loop.o          \
56         macrotab.o      \
57         main.o          \
58         opcodes.o       \
59         preproc.o       \
60         pragma.o        \
61         scanner.o       \
62         segments.o      \
63         stdfunc.o       \
64         stmt.o          \
65         symentry.o      \
66         symtab.o        \
67         textseg.o       \
68         typecmp.o       \
69         util.o
70
71 LIBS =  $(COMMON)/common.a
72
73
74 # ------------------------------------------------------------------------------
75 # Makefile targets
76
77 # Main target - must be first
78 .PHONY: all
79 ifeq (.depend,$(wildcard .depend))
80 all:    $(EXE)
81 include .depend
82 else
83 all:    depend
84         @$(MAKE) -f make/gcc.mak all
85 endif
86
87 $(EXE): $(OBJS) $(LIBS)
88         $(CC) $(LDFLAGS) -o $(EXE) $(CFLAGS) $(OBJS) $(LIBS)
89         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
90
91 clean:
92         rm -f *~ core *.map
93
94 zap:    clean
95         rm -f *.o $(EXE) .depend
96
97 # ------------------------------------------------------------------------------
98 # Make the dependencies
99
100 .PHONY: depend dep
101 depend dep:     $(OBJS:.o=.c)
102         @echo "Creating dependency information"
103         $(CC) -I$(COMMON) -MM $^ > .depend
104
105