Use pkg-config
authornorly <ny-git@enpas.org>
Tue, 12 Feb 2013 15:44:48 +0000 (15:44 +0000)
committernorly <ny-git@enpas.org>
Mon, 3 Jun 2013 01:08:00 +0000 (02:08 +0100)
Makefile

index b62b9ab7582ca6af70f0a73df2d214b412ad8cce..41e8fe5a34ee5be4a53b272f363d20e1e0179d2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
 PROJ := elfedit
 
+LIBRARIES := libelf
+
 BUILDDIR   := build
 INCLUDEDIR := include
 SRCDIR     := src
@@ -11,9 +13,9 @@ HEADERS += $(shell find $(SRCDIR)/ -iname "*.h")
 SOURCES := $(shell find $(SRCDIR)/ -iname "*.c")
 OBJS    := $(patsubst %.c, $(BUILDDIR)/%.o, $(SOURCES))
 
-INCLUDES := $(patsubst %, -I%, $(INCLUDEDIR) $(SRCDIR))
-CFLAGS   := -g -Wall
-LDFLAGS  := -lelf
+INCLUDES := $(patsubst %, -I%, $(INCLUDEDIR) $(SRCDIR)) $(shell pkg-config --cflags-only-I $(LIBRARIES))
+CFLAGS   := -g -Wall $(shell pkg-config --cflags-only-other $(LIBRARIES))
+LDFLAGS  := $(shell pkg-config --libs $(LIBRARIES))