]> 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         system.o
27
28 LIBS = $(COMMON)/common.a
29
30 EXECS = sim65
31
32 .PHONY: all
33 ifeq (.depend,$(wildcard .depend))
34 all:    $(EXECS) chips
35 include .depend
36 else
37 all:    depend
38         @$(MAKE) -f make/gcc.mak all
39 endif
40
41
42 sim65:  $(OBJS) $(LIBS)
43         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) -ldl
44         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
45
46 .PHONY: chips
47 chips:
48         @$(MAKE) -C chips -f make/gcc.mak
49
50
51 clean:
52         @$(MAKE) -C chips -f make/gcc.mak clean
53         rm -f *~ core *.lst
54
55 zap:    clean
56         @$(MAKE) -C chips -f make/gcc.mak zap
57         rm -f *.o $(EXECS) .depend
58
59 # ------------------------------------------------------------------------------
60 # Make the dependencies
61
62 .PHONY: depend dep
63 depend dep:     $(OBJS:.o=.c)
64         @echo "Creating dependency information"
65         $(CC) -I$(COMMON) -MM $^ > .depend
66
67