From e5cf5666e00828a3769fcda4717b0ee6f277001d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 18 Feb 2024 16:49:58 +0100 Subject: [PATCH] Makefile: make it idiomatic, respect CPPFLAGS, CFLAGS and LDFLAGS Respect CPPFLAGS, CFLAGS, and LDFLAGS. Use the implicit rule for object files. No need to specify default, the first target is the default target. --- Makefile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 98917c4..fc14069 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,8 @@ CC=gcc -LINK_OPT=-lbluetooth RM=rm -default: bdaddr - bdaddr: bdaddr.o oui.o - $(CC) -o bdaddr bdaddr.o oui.o $(LINK_OPT) - -bdaddr.o: bdaddr.c - $(CC) -c bdaddr.c - -oui.o: oui.c - $(CC) -c oui.c + $(CC) $(LDFLAGS) -o $@ $^ -lbluetooth clean: $(RM) -f *.o