]> git.sur5r.net Git - cc65/blob - src/sim65/make/gcc.mak
Working on the plugins
[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 =  chip.o          \
14         chiplib.o       \
15         chippath.o      \
16         cpucore.o       \
17         cputype.o       \
18         error.o         \
19         global.o        \
20         main.o          \
21         memory.o
22
23 LIBS = $(COMMON)/common.a
24
25 EXECS = sim65
26
27 .PHONY: all
28 ifeq (.depend,$(wildcard .depend))
29 all:    $(EXECS) chips
30 include .depend
31 else
32 all:    depend
33         @$(MAKE) -f make/gcc.mak all
34 endif
35
36
37 sim65:  $(OBJS) $(LIBS)
38         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) -ldl
39         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
40
41 .PHONY: chips
42 chips:
43         @$(MAKE) -C chips -f make/gcc.mak
44
45
46 clean:
47         @$(MAKE) -C chips -f make/gcc.mak clean
48         rm -f *~ core *.lst
49
50 zap:    clean
51         @$(MAKE) -C chips -f make/gcc.mak zap
52         rm -f *.o $(EXECS) .depend
53
54 # ------------------------------------------------------------------------------
55 # Make the dependencies
56
57 .PHONY: depend dep
58 depend dep:     $(OBJS:.o=.c)
59         @echo "Creating dependency information"
60         $(CC) -I$(COMMON) -MM $^ > .depend
61
62