0001-fix-makefile.patch
1.25 KB
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
Various makefile fixes to allow cross compilation
Partly ported from
http://anonscm.debian.org/cgit/pkg-games/libsoil.git/tree/debian/patches/linking_correctly.patch
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
diff -uNr soil.org/projects/makefile/alternate_Makefile.txt soil/projects/makefile/alternate_Makefile.txt
--- soil.org/projects/makefile/alternate_Makefile.txt 2008-07-07 18:13:28.000000000 +0200
+++ soil/projects/makefile/alternate_Makefile.txt 2015-11-07 11:15:04.140106336 +0100
@@ -1,8 +1,8 @@
MAKE = make
-CC = gcc
-INSTALL_FILE = install -p -o root -g root -m 644
-INSTALL_DIR = install -p -o root -g root -d
-LN = ln -s
+CC = $(GCC)
+INSTALL_FILE = $(INSTALL) -m 644
+INSTALL_DIR = $(INSTALL) -d
+LN = ln -sf
RM = rm -fv
CFLAGS += -c -O2 -Wall
LDFLAGS +=
@@ -23,13 +23,13 @@
all: $(OFILES) lib
%.o: %.c
- $(CC) $(CFLAGS) $< -o $@
+ $(CC) $(CFLAGS) -c -fPIC $< -o $@
lib: $(OFILES)
# create static library
- ar -cvq $(LIBNAME).a $(OFILES)
+ $(AR) -cvq $(LIBNAME).a $(OFILES)
# create shared library
- gcc -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIBNAME).so.$(VERSION) $(OFILES)
+ $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIBNAME).so.$(VERSION) $(OFILES) -lGL -lm
install:
$(INSTALL_DIR) $(DESTDIR)/$(INCLUDEDIR)