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