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