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