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