summaryrefslogtreecommitdiff
path: root/graphics/yukon/files/patch-Makefile
blob: 657c2a34e73e326eb8adfc4fcbf7bbdb83a75dca (plain) (blame)
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
45
46
47
48
49
50
51
52
53
Index: Makefile
===================================================================
--- Makefile	(revision 158)
+++ Makefile	(working copy)
@@ -1,15 +1,14 @@
 
 DESTDIR  = 
-PREFIX   = /usr/local
 LIBDIR   = lib
 
 CC       = gcc
-CFLAGS   = -Iinclude -Wall -std=c99 -O3
+CFLAGS   = -I${PWD}/include -Wall -std=c99 -O3 -I$(LOCALBASE)/include -L$(LOCALBASE)/lib
 
 OBJS     = src/core/conf.o src/core/glue.o src/core/log.o
 LIBS     = libX11.so libGL.so
 
--include config.make
+###-include config.make
 
 .PHONY: all clean install
 all: $(LIBS) yukon-core-lib sysconf
@@ -23,20 +22,25 @@
 	rm -f $@.native
 
 yukon-core-lib: $(OBJS)
-	$(CC) -shared -o $@ $(OBJS) -lseom
+	$(CC) -shared -o $@ $(OBJS) -lseom -L${LOCALBASE}/lib
 
 sysconf:
 	echo 'LDPATH="$(PREFIX)/$(LIBDIR)/yukon"' > $@
 
-soname = `objdump -x /usr/$(LIBDIR)/$(1) | grep SONAME | awk '{ print $$2 }'`
+soname = `objdump -x $(PREFIX)/$(LIBDIR)/$(1) | grep SONAME | awk '{ print $$2 }'`
 install: $(LIBS) yukon-core-lib
 	install -m 755 -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/$(LIBDIR)/yukon
 	install -m 755 src/scripts/yukon $(DESTDIR)$(PREFIX)/bin
 	install -m 755 yukon-core-lib $(DESTDIR)$(PREFIX)/$(LIBDIR)/yukon
+	ln -sf $(LOCALBASE)/lib/libX11.so.$(LIBX11_MAJOR) \
+	    $(PREFIX)/$(LIBDIR)/yukon/libX11.so.native
+	ln -sf $(LOCALBASE)/lib/libGL.so.$(LIBGL_MAJOR) \
+	    $(PREFIX)/$(LIBDIR)/yukon/libGL.so.native
+	install -m 755 libX11.so \
+	    $(PREFIX)/$(LIBDIR)/yukon/libX11.so.$(LIBX11_MAJOR)
+	install -m 755 libGL.so \
+	    $(PREFIX)/$(LIBDIR)/yukon/libGL.so.$(LIBGL_MAJOR)
 
-	$(foreach lib,$(LIBS),ln -sf /usr/$(LIBDIR)/$(lib) $(DESTDIR)$(PREFIX)/$(LIBDIR)/yukon/$(lib).native;)
-	$(foreach lib,$(LIBS),install -m 755 $(lib) $(DESTDIR)$(PREFIX)/$(LIBDIR)/yukon/$(call soname,$(lib));)
-
 clean:
 	rm -f $(OBJS) $(LIBS) yukon-core-lib sysconf