1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
From: Helmut Grohne <helmut@subdivi.de>
Subject: make pkg-config substitutable for cross compilation
Bug-Debian: https://bugs.debian.org/877788
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ XLIBPATH=/usr/X11R6/lib
# Sets some flags for stricter compiling
CFLAGS=-pedantic -Wall -W -O
+PKG_CONFIG ?= pkg-config
+
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# Leave the rest of the Makefile alone if you want it to build! #
@@ -33,10 +35,10 @@ $(target): $(sources:.c=.o)
$(CC) $(CFLAGS) \
$^ -o $@ \
-L$(XLIBPATH) -lX11 \
- `pkg-config --libs glib-2.0`
+ `$(PKG_CONFIG) --libs glib-2.0`
%.o: %.c
- $(CC) -c $(CFLAGS) `pkg-config --cflags glib-2.0` $<
+ $(CC) -c $(CFLAGS) `$(PKG_CONFIG) --cflags glib-2.0` $<
version.h: version.h.in Makefile
sed -e "s/@VERSION@/$(VERSION)/" version.h.in > $@
|