Mercurial > repos > simple16
annotate Makefile @ 7:8f9a05e2e425
Added clean rule
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 26 Mar 2016 23:36:33 -0700 |
parents | 74a6d629b78f |
children | 5176efdda5ae |
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 | 12 clean : |
13 rm -f $(TARGETDIR)/*.o $(TARGETDIR)/s16 $(TARGETDIR)/asm | |
0
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 |
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 $(TARGETDIR)/s16 : $(TARGETDIR)/main.o $(TARGETDIR)/cpu.o |
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 $(CC) -o $@ $^ $(LDFLAGS) |
6
74a6d629b78f
Added assembler. Removed hand-assembled version of hello world example
Michael Pavone <pavone@retrodev.com>
parents:
0
diff
changeset
|
17 |
74a6d629b78f
Added assembler. Removed hand-assembled version of hello world example
Michael Pavone <pavone@retrodev.com>
parents:
0
diff
changeset
|
18 $(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
|
19 $(CC) -o $@ $^ $(LDFLAGS) |
0
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 $(TARGETDIR)/%.o : src/%.c |
7e44f7d5810b
Initial commit. CPU working well enough for simple hello world program.
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 $(CC) $(CFLAGS) -c -o $@ $< |