Fix Error build of initdb 16/3816/1
authorBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Wed, 5 Jun 2013 11:24:47 +0000 (13:24 +0200)
committerBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Wed, 5 Jun 2013 11:24:47 +0000 (13:24 +0200)
schema/db-gen/Makefile

index 6fa00e1..a1b8ab1 100755 (executable)
@@ -4,8 +4,10 @@ REQUIRED_PKG = db-util
 CFLAGS = -g -Wall #-fprofile-arcs -ftest-coverage
 LDFLAGS =
 ifdef REQUIRED_PKG
-       CFLAGS += `pkg-config --cflags $(REQUIRED_PKG)`
-       LDFLAGS += `pkg-config --libs $(REQUIRED_PKG)`
+       CFLAGS += $(shell pkg-config --cflags $(REQUIRED_PKG))
+       LDFLAGS += -L$(shell pkg-config --variable=libdir $(REQUIRED_PKG))
+       LDFLAGS += $(shell pkg-config --libs $(REQUIRED_PKG))
+       
 endif
 
 SRCS = $(wildcard ../initdb.c)
@@ -14,8 +16,8 @@ TARGETS = $(OBJECTS:.o=)
 
 all: $(TARGETS)
 
-% : %.o
-       $(CC) $(LDFLAGS) -o $@ $<
+$(TARGETS) : $(SRCS)
+       $(CC) $(CFLAGS) $<  $(LDFLAGS)  -o $@
 
 clean:
        rm -rf $(OBJECTS) $(TARGETS)