Factor out symbol table handling
[centaur.git] / Makefile
index b62b9ab7582ca6af70f0a73df2d214b412ad8cce..641817907db2fd85c684f8b4b4991d0120f9eac3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
-PROJ := elfedit
+PROJ := elfucli
+
+LIBRARIES := libelf
 
 BUILDDIR   := build
 INCLUDEDIR := include
@@ -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))
 
 
 
@@ -23,6 +25,7 @@ default: $(EXE)
 
 .PHONY: check
 check: $(EXE)
+       $(error the re-layouting has broken make check for now, sorry.)
        $(EXE) $(EXE) -o testexe
        @cmp $(EXE) testexe
        @rm testexe