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 29 30 31 32 33 34 35 36 37 38 39 40
|
From 2636a3ea2b7d3be202ab74b3a28fe819b2e8d675 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 1 Jan 2014 16:11:03 +0000
Subject: Allow overriding various make variables, for cross-building
Forwarded: yes
Last-Update: 2012-04-01
Patch-Name: makefile-override.patch
---
Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index a353a81..152d564 100644
--- a/Makefile
+++ b/Makefile
@@ -5,17 +5,18 @@ GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut
CFLAGS:=-g3 -O2 -Wall -Werror
LFLAGS:=
CC:=gcc
+PKG_CONFIG:=pkg-config
-CFLAGS += $(shell pkg-config --cflags libxml-2.0)
-LFLAGS += -lpopt $(shell pkg-config --libs libxml-2.0)
+LIBXML_CFLAGS := $(shell $(PKG_CONFIG) --cflags libxml-2.0)
+LIBXML_LFLAGS := $(shell $(PKG_CONFIG) --libs libxml-2.0)
all : dumpet
dumpet : dumpet.o
- $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) -lpopt $(LIBXML_LFLAGS)
dumpet.o : dumpet.c dumpet.h iso9660.h eltorito.h endian.h
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(LIBXML_CFLAGS) -c -o $@ $<
clean :
@rm -vf *.o dumpet
|