File: makefile-override.patch

package info (click to toggle)
dumpet 2.1-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 152 kB
  • sloc: ansic: 908; makefile: 76
file content (32 lines) | stat: -rw-r--r-- 900 bytes parent folder | download
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
Description: Allow overriding various make variables, for cross-building
Author: Colin Watson <cjwatson@debian.org>
Forwarded: yes
Last-Update: 2012-04-01

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -5,17 +5,18 @@
 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