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