summaryrefslogtreecommitdiffstats
path: root/patches/hpanel-0.3.2/cross.patch
blob: 3087bbe1d00ceacca81ae1f611ea552e42dbf44a (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
Subject: Patches the Makefile to be able to cross compile
From: j.beisert@pengutronix.de

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).

Signed-off-by: j.beisert@pengutronix.de

---
 Makefile |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

Index: b/Makefile
===================================================================
--- 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
+LDFLAGS +=`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)
+