]> git.sur5r.net Git - cc65/blob - src/da65/make/gcc.mak
Support for the Mitsubishi 740 CPU for da65. Written and contributed by
[cc65] / src / da65 / make / gcc.mak
1 #
2 # gcc Makefile for da65
3 #
4
5 # ------------------------------------------------------------------------------
6
7 # The executable to build
8 EXE     = da65
9
10 # Library dir
11 COMMON  = ../common
12
13 #
14 CC      = gcc
15 CFLAGS  = -g -O2 -Wall -W -std=c89
16 override CFLAGS += -I$(COMMON)
17 EBIND   = emxbind
18 LDFLAGS =
19
20
21 # -----------------------------------------------------------------------------
22 # List of all object files
23
24 OBJS =  asminc.o        \
25         attrtab.o       \
26         code.o          \
27         comments.o      \
28         data.o          \
29         error.o         \
30         global.o        \
31         handler.o       \
32         infofile.o      \
33         labels.o        \
34         main.o          \
35         opc6502.o       \
36         opc6502x.o      \
37         opc65816.o      \
38         opc65c02.o      \
39         opc65sc02.o     \
40         opchuc6280.o    \
41         opcm740.o       \
42         opctable.o      \
43         output.o        \
44         scanner.o       \
45         segment.o
46
47 LIBS = $(COMMON)/common.a
48
49
50 # ------------------------------------------------------------------------------
51 # Makefile targets
52
53 # Main target - must be first
54 .PHONY: all
55 ifeq (.depend,$(wildcard .depend))
56 all:    $(EXE)
57 include .depend
58 else
59 all:    depend
60         @$(MAKE) -f make/gcc.mak all
61 endif
62
63 $(EXE): $(OBJS) $(LIBS)
64         $(CC) $(LDFLAGS) $^ -o $@
65         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
66
67 clean:
68         $(RM) *~ core.* *.map
69
70 zap:    clean
71         $(RM) *.o $(EXE) .depend
72
73 # ------------------------------------------------------------------------------
74 # Make the dependencies
75
76 .PHONY: depend dep
77 depend dep:     $(OBJS:.o=.c)
78         @echo "Creating dependency information"
79         $(CC) $(CFLAGS) -MM $^ > .depend
80
81