Permalink
Browse files

Properly find check using pkg-config.

  • Loading branch information...
1 parent 1358a83 commit 29c7f8b702fa4d118efa20f45df5a3a883118c20 @nelhage committed Dec 29, 2008
Showing with 6 additions and 4 deletions.
  1. +6 −4 Makefile
View
@@ -1,10 +1,11 @@
+CC=gcc
CFLAGS=-g -Wall $(DEFS)
OBJECTS=gc.o symbol.o read.o
-TEST_CFLAGS=
-TEST_LIBS=
+TEST_CFLAGS=$(shell pkg-config check --cflags)
+TEST_LIBS=$(shell pkg-config check --libs)
TEST_LDFLAGS=
-TEST_OBJECTS=tests.o /usr/lib/libcheck.a
+TEST_OBJECTS=tests.o
TESTER=tests
all: check
@@ -14,7 +15,8 @@ check: $(TESTER)
$(TEST_OBJECTS): CFLAGS += $(TEST_CFLAGS)
-$(TESTER): LDFLAGS += $(TEST_LDFLAGS) $(foreach lib,$(TEST_LIBS), -l$(lib))
+$(TESTER): LDFLAGS += $(TEST_LDFLAGS)
+$(TESTER): LDLIBS += $(TEST_LIBS)
$(TESTER): $(TEST_OBJECTS) $(OBJECTS)
clean:

0 comments on commit 29c7f8b

Please sign in to comment.