annotate Makefile @ 9:a3f14b00aead

Modified Makefile to automatically create target directories if they don't already exist
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Mar 2016 16:15:46 -0700
parents 5176efdda5ae
children 04d8efe7a1f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 ifdef DEBUG
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 CFLAGS:=-ggdb $(CFLAGS)
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 LDFLAGS:=-ggdb $(LDFLAGS)
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 TARGETDIR:=debug
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 else
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 CFLAGS:=-O2
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 TARGETDIR:=release
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 endif #DEBUG
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 all : $(TARGETDIR)/s16
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11
7
8f9a05e2e425 Added clean rule
Michael Pavone <pavone@retrodev.com>
parents: 6
diff changeset
12 clean :
8f9a05e2e425 Added clean rule
Michael Pavone <pavone@retrodev.com>
parents: 6
diff changeset
13 rm -f $(TARGETDIR)/*.o $(TARGETDIR)/s16 $(TARGETDIR)/asm
9
a3f14b00aead Modified Makefile to automatically create target directories if they don't already exist
Michael Pavone <pavone@retrodev.com>
parents: 8
diff changeset
14
a3f14b00aead Modified Makefile to automatically create target directories if they don't already exist
Michael Pavone <pavone@retrodev.com>
parents: 8
diff changeset
15 $(TARGETDIR) :
a3f14b00aead Modified Makefile to automatically create target directories if they don't already exist
Michael Pavone <pavone@retrodev.com>
parents: 8
diff changeset
16 mkdir $(TARGETDIR)
0
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17
8
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents: 7
diff changeset
18 $(TARGETDIR)/s16 : $(TARGETDIR)/main.o $(TARGETDIR)/cpu.o $(TARGETDIR)/vdp.o
0
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 $(CC) -o $@ $^ $(LDFLAGS)
6
74a6d629b78f Added assembler. Removed hand-assembled version of hello world example
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
20
74a6d629b78f Added assembler. Removed hand-assembled version of hello world example
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
21 $(TARGETDIR)/asm : $(TARGETDIR)/asm.o $(TARGETDIR)/cpu.o
74a6d629b78f Added assembler. Removed hand-assembled version of hello world example
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
22 $(CC) -o $@ $^ $(LDFLAGS)
0
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23
9
a3f14b00aead Modified Makefile to automatically create target directories if they don't already exist
Michael Pavone <pavone@retrodev.com>
parents: 8
diff changeset
24 $(TARGETDIR)/%.o : src/%.c $(TARGETDIR)
0
7e44f7d5810b Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 $(CC) $(CFLAGS) -c -o $@ $<