bluetooth/Makefile
author Markus Bröker <mbroeker@largo.dyndns.tv>
Wed, 02 May 2012 20:51:14 +0200
changeset 165 f551b78c3eee
child 166 ecd6492274ad
permissions -rw-r--r--
a bluetooth and a c++ demo committer: Markus Bröker <mbroeker@largo.homelinux.org>

     CC = gcc -g -ggdb $(PROF)
    CPP = g++ -g -ggdb $(PROF)
 CFLAGS = -Wall -O2 -Iinclude $(EXTRA)
  EXTRA = -I/usr/local/include
LDFLAGS = -L/usr/lib -L/usr/local/lib
     RM = rm -f
   FIND = find
   MAKE = make
 INDENT = indent
 ERASER = eraser

ifeq ("$(PROFILER)", "linux")
   PROF = -fprofile-arcs -ftest-coverage -pg
endif

TARGET  = bluetooth
TARGET += bluetooth-client

.SUFFIXES: .c .cc .asm

.c.o:
	@echo Compiling $< ...
	@$(CC) -c $(CFLAGS) -o $@ $<

all: $(TARGET)

bluetooth: bluetooth.o
	@echo Linking $< ...
	@$(CC) $(LDFLAGS) -lbluetooth -o $@ $<

bluetooth-client: bluetooth-client.o
	@echo Linking $< ...
	@$(CC) $(LDFLAGS) -lbluetooth -o $@ $<

.PHONY: beauty clean uninstall

clean:
ifdef FIND
	$(FIND) . -name '*~' -exec $(RM) {} \;
	$(FIND) . -name '*.[oa]' -exec $(RM) {} \;
	$(FIND) . -name '*.gcov' -exec $(RM) {} \;
	$(FIND) . -name '*.gcda' -exec $(RM) {} \;
	$(FIND) . -name '*.gcno' -exec $(RM) {} \;
	$(FIND) . -name 'gmon.out' -exec $(RM) {} \;
endif
	$(RM) $(TARGET)

beauty:
ifdef FIND
	$(FIND) . -name '*.[ch]' -exec $(INDENT) {} \;
	$(FIND) . -name '*.[ch]' -exec $(ERASER) {} \;
	$(FIND) . -name '*.java' -exec $(ERASER) {} \;
	$(FIND) . -name 'Makefile*' -exec $(ERASER) {} \;
endif
	@$(MAKE) clean