author | Markus Bröker<broeker.markus@googlemail.com> |
Fri, 20 Oct 2017 06:46:47 +0200 | |
changeset 170 | 5a11538e7bc8 |
parent 166 | ecd6492274ad |
permissions | -rw-r--r-- |
66
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
1 |
CC = gcc -g -ggdb |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
2 |
CFLAGS = -Wall -O2 -Iinclude |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
3 |
LDFLAGS = |
166 | 4 |
NASM = nasm -f elf64 -Iinclude/ |
66
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
5 |
TARGET = stackinfo |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
6 |
OBJECTS = main.o |
2b4f786d9073
Common Makefile Style NAME += OBJECT
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
5
diff
changeset
|
7 |
OBJECTS += get_sp.o |
5
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
8 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
9 |
.SUFFIXES: .c .asm |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
10 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
11 |
.c.o: |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
12 |
@echo Compiling $< ... |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
13 |
@$(CC) -c $(CFLAGS) -o $@ $< |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
14 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
15 |
.asm.o: |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
16 |
@echo Assembling $< ... |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
17 |
@$(NASM) $< -o $@ |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
18 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
19 |
all: $(TARGET) decimal |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
20 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
21 |
$(TARGET): $(OBJECTS) |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
22 |
@echo Linking $(OBJECTS) ... |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
23 |
@$(CC) $(LDFLAGS) $(OBJECTS) -o $@ |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
24 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
25 |
decimal: decimal.o |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
26 |
$(CC) $(CFLAGS) -o $@ $< |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
27 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
28 |
.PHONY: clean uninstall |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
29 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
30 |
clean: |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
31 |
rm -f $(TARGET) decimal *.o *~ |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
32 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
33 |
install: $(TARGET) decimal |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
34 |
install -d ~/bin |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
35 |
install $(TARGET) decimal ~/bin |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
36 |
|
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
37 |
uninstall: |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
38 |
rm -f ~/bin/decimal |
d752cbe8208e
asm and parser demos added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
39 |
rm -f ~/bin/$(TARGET) |