]> git.sur5r.net Git - cc65/blob - src/cc65/make/gcc.mak
Working on the new backend. Moved the files from the b6502 into the main
[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         codeopt.o       \
32         codeseg.o       \
33         compile.o       \
34         cpu.o           \
35         dataseg.o       \
36         datatype.o      \
37         declare.o       \
38         declattr.o      \
39         error.o         \
40         expr.o          \
41         exprheap.o      \
42         exprnode.o      \
43         funcdesc.o      \
44         funcinfo.o      \
45         function.o      \
46         global.o        \
47         goto.o          \
48         ident.o         \
49         incpath.o       \
50         input.o         \
51         litpool.o       \
52         locals.o        \
53         loop.o          \
54         macrotab.o      \
55         main.o          \
56         opcodes.o       \
57         preproc.o       \
58         pragma.o        \
59         scanner.o       \
60         segname.o       \
61         stdfunc.o       \
62         stmt.o          \
63         symentry.o      \
64         symtab.o        \
65         typecmp.o       \
66         util.o
67
68 LIBS =  $(COMMON)/common.a
69
70
71 # ------------------------------------------------------------------------------
72 # Makefile targets
73
74 # Main target - must be first
75 .PHONY: all
76 ifeq (.depend,$(wildcard .depend))
77 all:    $(EXE)
78 include .depend
79 else
80 all:    depend
81         @$(MAKE) -f make/gcc.mak all
82 endif
83
84 $(EXE): $(OBJS) $(LIBS)
85         $(CC) $(LDFLAGS) -o $(EXE) $(CFLAGS) $(OBJS) $(LIBS)
86         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
87
88 clean:
89         rm -f *~ core *.map
90
91 zap:    clean
92         rm -f *.o $(EXE) .depend
93
94 # ------------------------------------------------------------------------------
95 # Make the dependencies
96
97 .PHONY: depend dep
98 depend dep:     $(OBJS:.o=.c)
99         @echo "Creating dependency information"
100         $(CC) -I$(COMMON) -MM $^ > .depend
101
102