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-- |
165
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
1 |
CC = gcc -g -ggdb $(PROF) |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
2 |
CPP = g++ -g -ggdb $(PROF) |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
3 |
CFLAGS = -Wall -O2 -Iinclude $(EXTRA) |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
4 |
EXTRA = -I/usr/local/include |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
5 |
LDFLAGS = -L/usr/lib -L/usr/local/lib |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
6 |
RM = rm -f |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
7 |
FIND = find |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
8 |
MAKE = make |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
9 |
INDENT = indent |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
10 |
ERASER = eraser |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
11 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
12 |
ifeq ("$(PROFILER)", "linux") |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
13 |
PROF = -fprofile-arcs -ftest-coverage -pg |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
14 |
endif |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
15 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
16 |
TARGET = bluetooth |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
17 |
TARGET += bluetooth-client |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
18 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
19 |
.SUFFIXES: .c .cc .asm |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
20 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
21 |
.c.o: |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
22 |
@echo Compiling $< ... |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
23 |
@$(CC) -c $(CFLAGS) -o $@ $< |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
24 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
25 |
all: $(TARGET) |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
26 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
27 |
bluetooth: bluetooth.o |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
28 |
@echo Linking $< ... |
166 | 29 |
@$(CC) $< $(LDFLAGS) -lbluetooth -o $@ |
165
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
30 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
31 |
bluetooth-client: bluetooth-client.o |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
32 |
@echo Linking $< ... |
166 | 33 |
@$(CC) $< $(LDFLAGS) -lbluetooth -o $@ |
165
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
34 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
35 |
.PHONY: beauty clean uninstall |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
36 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
37 |
clean: |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
38 |
ifdef FIND |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
39 |
$(FIND) . -name '*~' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
40 |
$(FIND) . -name '*.[oa]' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
41 |
$(FIND) . -name '*.gcov' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
42 |
$(FIND) . -name '*.gcda' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
43 |
$(FIND) . -name '*.gcno' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
44 |
$(FIND) . -name 'gmon.out' -exec $(RM) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
45 |
endif |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
46 |
$(RM) $(TARGET) |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
47 |
|
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
48 |
beauty: |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
49 |
ifdef FIND |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
50 |
$(FIND) . -name '*.[ch]' -exec $(INDENT) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
51 |
$(FIND) . -name '*.[ch]' -exec $(ERASER) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
52 |
$(FIND) . -name '*.java' -exec $(ERASER) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
53 |
$(FIND) . -name 'Makefile*' -exec $(ERASER) {} \; |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
54 |
endif |
f551b78c3eee
a bluetooth and a c++ demo
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
55 |
@$(MAKE) clean |