]> git.sur5r.net Git - cc65/blob - src/cc65/make/gcc.mak
Rewrite/cleanup of the complete expression flags handling.
[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 # The compiler library search path. Default is "/usr/lib/cc65/include/" if
16 # nothing is defined
17 #CDEFS=-DCC65_INC=\"/usr/lib/cc65/include/\"
18
19 #
20 CFLAGS = -O2 -g -Wall -W -I$(COMMON) $(CDEFS)
21 CC=gcc
22 EBIND=emxbind
23 LDFLAGS=
24
25 # ------------------------------------------------------------------------------
26 # Object files and libraries to link
27
28 OBJS =  anonname.o      \
29         asmcode.o       \
30         asmlabel.o      \
31         asmstmt.o       \
32         assignment.o    \
33         casenode.o      \
34         codeent.o       \
35         codegen.o       \
36         codelab.o       \
37         codeinfo.o      \
38         codeopt.o       \
39         codeseg.o       \
40         compile.o       \
41         coptadd.o       \
42         coptc02.o       \
43         coptcmp.o       \
44         coptind.o       \
45         coptneg.o       \
46         coptpush.o      \
47         coptsize.o      \
48         coptstop.o      \
49         coptstore.o     \
50         coptsub.o       \
51         copttest.o      \
52         dataseg.o       \
53         datatype.o      \
54         declare.o       \
55         declattr.o      \
56         error.o         \
57         expr.o          \
58         exprdesc.o      \
59         exprnode.o      \
60         funcdesc.o      \
61         function.o      \
62         global.o        \
63         goto.o          \
64         hexval.o        \
65         ident.o         \
66         incpath.o       \
67         input.o         \
68         lineinfo.o      \
69         litpool.o       \
70         locals.o        \
71         loop.o          \
72         macrotab.o      \
73         main.o          \
74         opcodes.o       \
75         preproc.o       \
76         pragma.o        \
77         reginfo.o       \
78         scanner.o       \
79         scanstrbuf.o    \
80         segments.o      \
81         stdfunc.o       \
82         stdnames.o      \
83         stmt.o          \
84         swstmt.o        \
85         symentry.o      \
86         symtab.o        \
87         testexpr.o      \
88         textseg.o       \
89         typecmp.o       \
90         typeconv.o      \
91         util.o
92
93 LIBS =  $(COMMON)/common.a
94
95
96 # ------------------------------------------------------------------------------
97 # Makefile targets
98
99 # Main target - must be first
100 .PHONY: all
101 ifeq (.depend,$(wildcard .depend))
102 all:    $(EXE)
103 include .depend
104 else
105 all:    depend
106         @$(MAKE) -f make/gcc.mak all
107 endif
108
109 $(EXE): $(OBJS) $(LIBS)
110         $(CC) $(LDFLAGS) -o $(EXE) $(CFLAGS) $(OBJS) $(LIBS)
111         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
112
113 clean:
114         $(RM) *~ core *.map
115
116 zap:    clean
117         $(RM) *.o $(EXE) .depend
118
119 # ------------------------------------------------------------------------------
120 # Make the dependencies
121
122 .PHONY: depend dep
123 depend dep:     $(OBJS:.o=.c)
124         @echo "Creating dependency information"
125         $(CC) -I$(COMMON) -MM $^ > .depend
126
127
128