bluetooth/Makefile
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--
hgignore added

     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