forked from TACC/GLuRay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
executable file
·144 lines (107 loc) · 3.45 KB
/
Makefile.in
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Copyright (C) 2000 Marcelo E. Magallon <[email protected]>
#
# This Makefile is free software; the author gives unlimited permission
# to copy and/or distribute it, with or without modifications, as long
# as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#############################################################
# These bits come from configure
#############################################################
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@SET_MAKE@
#############################################################
# These bits are hand-written down-to-earth makefile stuff
#############################################################
MAJOR := 0
MINOR := 1
VERSION := $(MAJOR).$(MINOR)
LIBNAME := libfakeGL.so
FAKELIB := $(LIBNAME).$(VERSION)
SONAME := $(LIBNAME).$(MAJOR)
HELPER := spyglass-helper
HELPERBIN := $(HELPER).real
SOFLAGS := -fPIC
COMPILE := $(CC) -c
# _GNU_SOURCE is needed for strncat; if I ever port this to a non-GNU platform
# I'll end up writing strndup myself and removing this.
CPPFLAGS := -D_GNU_SOURCE
CFLAGS := -O2 -Wall
# Use this if you want to have libfakeGL dlopen the system's OpenGL lib
# CPPFLAGS += -DDLOPEN_GL_LIB
# Use and change this if your system's OpenGL lib is somewhere else
# CPPFLAGS += -DOPENGLLIB=\"/usr/lib/libGL.so.1\"
LDLIBS := -ldl
FAKELIBSRC := libfakeGL.c
FAKELIBOBJS := $(FAKELIBSRC:.c=.o)
FAKELIBAUTOSRC := gl_function_table.c
GENTABLE := $(PWD)/gentable.pl
LN := ln -sf
GARBAGE := $(FAKELIBOBJS) \
$(FAKELIBAUTOSRC) \
$(LIBNAME) \
$(FAKELIB) \
$(SONAME) \
$(HELPERBIN)
TARGETS := $(SONAME) $(HELPER)
all: $(TARGETS)
$(FAKELIB): $(FAKELIBOBJS)
$(CC) -shared -o $@ -Wl,-soname,$(SONAME) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS)
$(HELPER): $(HELPERBIN)
touch $@
$(HELPERBIN): spyglass-helper.c $(LIBNAME)
$(CC) -o $@ $^
$(SONAME): $(FAKELIB)
$(LN) $^ $@
$(LIBNAME): $(SONAME)
$(LN) $^ $@
$(FAKELIBOBJS): %.o: %.c
$(COMPILE) -o $@ $(CPPFLAGS) $(CFLAGS) $(SOFLAGS) $<
libfakeGL.o: $(FAKELIBAUTOSRC)
libfakeGL.c: $(FAKELIBAUTOSRC)
$(FAKELIBAUTOSRC): $(GENTABLE)
$^ specs/gl.spec gl > $@
clean:
$(RM) $(GARBAGE)
$(RM) *~
distclean mrproper: clean
$(RM) Makefile
install: all
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
$(INSTALL_DATA) $(FAKELIB) $(DESTDIR)$(pkglibdir)
ln -sf $(FAKELIB) $(DESTDIR)$(pkglibdir)/$(LIBNAME)
ln -sf $(FAKELIB) $(DESTDIR)$(pkglibdir)/$(SONAME)
$(INSTALL_SCRIPT) $(HELPER) $(DESTDIR)$(pkglibdir)
$(INSTALL_PROGRAM) $(HELPERBIN) $(DESTDIR)$(pkglibdir)
.PHONY: clean distclean mrproper
.NOEXPORT: