]> git.sur5r.net Git - cc65/blob - src/sim65/make/gcc.mak
New callback module
[cc65] / src / sim65 / make / gcc.mak
1 #
2 # gcc Makefile for sim65
3 #
4
5 # Library dir
6 COMMON  = ../common
7
8 CFLAGS  = -g -O2 -Wall -W -I$(COMMON)
9 CC      = gcc
10 EBIND   = emxbind
11 LDFLAGS =
12
13 OBJS =  addrspace.o     \
14         callback.o      \
15         cfgdata.o       \
16         chip.o          \
17         chippath.o      \
18         config.o        \
19         cpucore.o       \
20         cputype.o       \
21         error.o         \
22         global.o        \
23         location.o      \
24         main.o          \
25         memory.o        \
26         scanner.o       \
27         system.o
28
29 LIBS = $(COMMON)/common.a
30
31 EXECS = sim65
32
33 .PHONY: all
34 ifeq (.depend,$(wildcard .depend))
35 all:    $(EXECS) chips
36 include .depend
37 else
38 all:    depend
39         @$(MAKE) -f make/gcc.mak all
40 endif
41
42
43 sim65:  $(OBJS) $(LIBS)
44         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) -ldl
45         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
46
47 .PHONY: chips
48 chips:
49         @$(MAKE) -C chips -f make/gcc.mak
50
51
52 clean:
53         @$(MAKE) -C chips -f make/gcc.mak clean
54         rm -f *~ core *.lst
55
56 zap:    clean
57         @$(MAKE) -C chips -f make/gcc.mak zap
58         rm -f *.o $(EXECS) .depend
59
60 # ------------------------------------------------------------------------------
61 # Make the dependencies
62
63 .PHONY: depend dep
64 depend dep:     $(OBJS:.o=.c)
65         @echo "Creating dependency information"
66         $(CC) -I$(COMMON) -MM $^ > .depend
67
68