]> git.sur5r.net Git - cc65/blob - src/ca65/make/gcc.mak
Replaced builtin macro packages with .mac files that are included like ordinary ...
[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 # -----------------------------------------------------------------------------
25 # List of all object files
26
27 OBJS =  anonname.o      \
28         asserts.o       \
29         condasm.o       \
30         dbginfo.o       \
31         ea65.o          \
32         easw16.o        \
33         enum.o          \
34         error.o         \
35         expr.o          \
36         feature.o       \
37         filetab.o       \
38         fragment.o      \
39         global.o        \
40         incpath.o       \
41         instr.o         \
42         istack.o        \
43         lineinfo.o      \
44         listing.o       \
45         macro.o         \
46         main.o          \
47         nexttok.o       \
48         objcode.o       \
49         objfile.o       \
50         options.o       \
51         pseudo.o        \
52         repeat.o        \
53         scanner.o       \
54         segdef.o        \
55         segment.o       \
56         sizeof.o        \
57         span.o          \
58         spool.o         \
59         struct.o        \
60         studyexpr.o     \
61         symentry.o      \
62         symbol.o        \
63         symtab.o        \
64         token.o         \
65         toklist.o       \
66         ulabel.o
67
68 # -----------------------------------------------------------------------------
69 # List of all macro files
70
71 LIBS = $(COMMON)/common.a
72
73 # ------------------------------------------------------------------------------
74 # Makefile targets
75
76 # Main target - must be first
77 .PHONY: all
78 ifeq (.depend,$(wildcard .depend))
79 all:    $(EXE)
80 include .depend
81 else
82 all:    depend
83         @$(MAKE) -f make/gcc.mak all
84 endif
85
86 $(EXE): $(OBJS) $(LIBS)
87         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
88         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
89
90 clean:
91         $(RM) *~ core.* *.map
92
93 zap:    clean
94         $(RM) *.o $(EXE) .depend
95
96 # ------------------------------------------------------------------------------
97 # Make the dependencies
98
99 .PHONY: depend dep
100 depend dep:     $(INCS) $(OBJS:.o=.c)
101         @echo "Creating dependency information"
102         $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend