forked from TACC/GLuRay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mac
executable file
·148 lines (110 loc) · 4.11 KB
/
Makefile.mac
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
145
146
147
148
# Generated automatically from Makefile.in by configure.
# 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 = /bin/sh
srcdir = .
top_srcdir = ../..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/spyglass
pkglibdir = $(libdir)/spyglass
pkgincludedir = $(includedir)/spyglass
top_builddir = ../..
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
#############################################################
# These bits are hand-written down-to-earth makefile stuff
#############################################################
MAJOR := 0
MINOR := 1
VERSION := $(MAJOR).$(MINOR)
LIBNAME := libfakeGL.dylib
FAKELIB := $(LIBNAME).$(VERSION)
SONAME := $(LIBNAME).$(MAJOR)
HELPER := spyglass-helper
HELPERBIN := $(HELPER).real
SOFLAGS := -fPIC
COMPILE := $(CC) -c
GL2MANTA_DIR := /Users/scerenon/svn/gl2manta
MANTA_BUILDDIR := /Users/scerenon/Manta/build
MANTA_SRCDIR := /Users/scerenon/Manta/src
INCLUDES := -I$(GL2MANTA_DIR)/gl2manta/include -I$(MANTA_BUILDDIR)/include -I$(MANTA_SRCDIR) -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/X11/include
# _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 -m32
CFLAGS :=
# 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 := -L$(GL2MANTA_DIR)/gl2manta/lib -L$(MANTA_BUILDDIR)/lib -lManta_Core -lManta_Engine -lManta_Factory -lManta_Interface -lManta_Model -lManta_Image -lManta_UserInterface -lManta_Core_XUtils -lAbout -lgl2manta -L/usr/X11/lib
FAKELIBSRC := libfakeGL.c
FAKELIBOBJS := $(FAKELIBSRC:.c=.o)
FAKELIBAUTOSRC := gl_function_table.c
GENTABLE := $(PWD)/gentable.pl
LN := ln -sf
GARBAGE := $(FAKELIBOBJS) \
$(LIBNAME) \
$(FAKELIB) \
$(SONAME) \
$(HELPERBIN)
TARGETS := $(SONAME) $(HELPER)
all: $(TARGETS)
$(FAKELIB): $(FAKELIBOBJS)
$(CC) $(CFLAGS) -o $@ -dynamiclib -Wl,-dylib_install_name -Wl,$(SONAME) $(INCLUDES) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS)
$(HELPER): $(HELPERBIN)
touch $@
$(HELPERBIN): spyglass-helper.c $(LIBNAME)
$(COMPILE) $(CFLAGS) -o $@ $^ $(LDLIBS) $(INCLUDES)
$(SONAME): $(FAKELIB)
$(LN) $^ $@
$(LIBNAME): $(SONAME)
$(LN) $^ $@
$(FAKELIBOBJS): %.o: %.c
$(COMPILE) -o $@ $(INCLUDES) $(CFLAGS) $(SOFLAGS) $(LDLIBS) $<
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: