summaryrefslogtreecommitdiffstats
path: root/patches/hpanel-0.3.2/0001-Patches-the-Makefile-to-be-able-to-cross-compile.patch
blob: f99a0028a637063cf5904d0235904ed1ad696bd0 (plain)
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
41
42
43
44
From: Juergen Beisert <j.beisert@pengutronix.de>
Date: Tue, 21 Jun 2011 09:27:25 +0200
Subject: [PATCH] Patches the Makefile to be able to cross compile

The original makefile assumes fixed pathes to libraries and
include files. This patch replace them with calls to pkg_config.
Don't strip the binary. targetinstall will do this.
Install to $(DESTDIR).

Forwarded: not-needed (upstream dead)
Signed-off-by: j.beisert@pengutronix.de
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 Makefile |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 9d20d90..28519a7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,14 @@
-CC=cc
-CFLAGS= -O2 -I/usr/X11R6/include -DHAVE_XPM -DXFT -DCLOCK
-LDFLAGS= -L/usr/X11R6/lib -lX11 -lXpm -lXft
+.PHONY: install clean
+
+CFLAGS +=-O2 -g `pkg-config --cflags xft` `pkg-config --cflags xpm` -DCLOCK
+LDLIBS +=`pkg-config --libs xft` `pkg-config --libs xpm`
 PROGNAME=hpanel
 
-$(PROGNAME): Makefile hpanel.c hpanel.h icon.xpm
-	$(CC) $(CFLAGS) $(LDFLAGS) hpanel.c -o $(PROGNAME)
-	@ls -l $(PROGNAME)
-	strip $(PROGNAME)
-	@ls -l $(PROGNAME)
+$(PROGNAME): hpanel.c
 
 install:
-	install $(PROGNAME) /usr/local/bin
+	install $(PROGNAME) $(DESTDIR)/usr/bin
+
+clean:
+	@rm -f $(PROGNAME)
+