bluetooth/Makefile
author Markus Bröker<broeker.markus@googlemail.com>
Sun, 10 Feb 2019 13:17:01 +0100
changeset 173 374a86886bc5
parent 166 ecd6492274ad
permissions -rw-r--r--
LAST-DIGIT-BUG: INCREMENT before LF

     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