]> git.sur5r.net Git - cc65/blob - src/sim65/make/gcc.mak
0638769d0bbd86924413894220851260809083f2
[cc65] / src / sim65 / make / gcc.mak
1 #
2 # gcc Makefile for sim65
3 #
4
5 # ------------------------------------------------------------------------------
6
7 # The executable to build
8 EXE     = sim65
9
10 # Library dir
11 COMMON  = ../common
12
13 #
14 CC      = gcc
15 CFLAGS  = -g -O2 -Wall -W -std=c89 
16 CFLAGS += -I$(COMMON)
17 EBIND   = emxbind
18 LDFLAGS =
19
20
21 # -----------------------------------------------------------------------------
22 # List of all object files
23
24 OBJS =  addrspace.o     \
25         callback.o      \
26         cfgdata.o       \
27         chip.o          \
28         chippath.o      \
29         config.o        \
30         cpucore.o       \
31         cputype.o       \
32         error.o         \
33         global.o        \
34         location.o      \
35         main.o          \
36         memory.o        \
37         scanner.o       \
38         system.o
39
40 LIBS = $(COMMON)/common.a
41
42 # ------------------------------------------------------------------------------
43 # Makefile targets
44
45 # Main target - must be first
46 .PHONY: all
47 ifeq (.depend,$(wildcard .depend))
48 all:    $(EXE) chips
49 include .depend
50 else
51 all:    depend
52         @$(MAKE) -f make/gcc.mak all
53 endif
54
55 $(EXE): $(OBJS) $(LIBS)
56         $(CC) $^ $(LDFLAGS) -o $@
57         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
58
59 .PHONY: chips
60 chips:
61         @$(MAKE) -C chips -f make/gcc.mak
62
63 clean:
64         $(RM) *~ core.* *.map
65
66 zap:    clean
67         $(RM) *.o $(EXE) .depend
68
69 # ------------------------------------------------------------------------------
70 # Make the dependencies
71
72 .PHONY: depend dep
73 depend dep:     $(OBJS:.o=.c)
74         @echo "Creating dependency information"
75         $(CC) $(CFLAGS) -MM $^ > .depend
76
77