2003-07-06 20:21:50 +00:00
|
|
|
#! gmake
|
2002-12-13 08:31:58 +00:00
|
|
|
## The OpenGL Extension Wrangler Library
|
2003-07-06 15:01:13 +00:00
|
|
|
## Copyright (C) 2003, 2002, Milan Ikits <milan.ikits@ieee.org>
|
|
|
|
## Copyright (C) 2003, 2002, Marcelo E. Magallon <mmagallo@debian.org>
|
|
|
|
## Copyright (C) 2002, Lev Povalahev <levp@gmx.net>
|
2003-05-01 18:42:38 +00:00
|
|
|
## All rights reserved.
|
|
|
|
##
|
|
|
|
## Redistribution and use in source and binary forms, with or without
|
|
|
|
## modification, are permitted provided that the following conditions are met:
|
|
|
|
##
|
|
|
|
## * Redistributions of source code must retain the above copyright notice,
|
|
|
|
## this list of conditions and the following disclaimer.
|
|
|
|
## * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
## this list of conditions and the following disclaimer in the documentation
|
|
|
|
## and/or other materials provided with the distribution.
|
|
|
|
## * The name of the author may be used to endorse or promote products
|
|
|
|
## derived from this software without specific prior written permission.
|
2002-12-13 08:31:58 +00:00
|
|
|
##
|
2003-05-01 18:42:38 +00:00
|
|
|
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
|
|
## THE POSSIBILITY OF SUCH DAMAGE.
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-05-04 19:54:07 +00:00
|
|
|
GLEW_DEST ?= /usr
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
GLEW_MAJOR = 1
|
|
|
|
GLEW_MINOR = 1
|
2003-09-25 23:30:52 +00:00
|
|
|
GLEW_MICRO = 3
|
2003-07-06 15:01:13 +00:00
|
|
|
GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO)
|
|
|
|
|
|
|
|
TARDIR = ../glew-$(GLEW_VERSION)
|
|
|
|
TARBALL = ../glew_$(GLEW_VERSION).tar.gz
|
|
|
|
|
|
|
|
SHELL = /bin/sh
|
2003-04-04 18:13:58 +00:00
|
|
|
SYSTEM = $(strip $(shell uname -s))
|
|
|
|
|
2003-10-27 01:06:34 +00:00
|
|
|
|
2003-09-25 23:30:52 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Cygwin
|
2003-08-11 18:27:41 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
2003-04-04 18:13:58 +00:00
|
|
|
ifeq ($(patsubst CYGWIN%,CYGWIN,$(SYSTEM)), CYGWIN)
|
|
|
|
NAME = glew32
|
2003-09-26 13:56:24 +00:00
|
|
|
CC = gcc -mno-cygwin
|
2003-09-26 12:13:38 +00:00
|
|
|
LD = ld
|
2003-09-26 13:56:24 +00:00
|
|
|
CFLAGS.EXTRA = -DGLEW_STATIC
|
2003-09-26 12:24:46 +00:00
|
|
|
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
|
2003-09-26 13:56:24 +00:00
|
|
|
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
|
2003-09-26 12:24:46 +00:00
|
|
|
LDFLAGS.EXTRA =
|
2003-09-26 13:56:24 +00:00
|
|
|
|
2003-09-25 23:30:52 +00:00
|
|
|
WARN = -Wall -W
|
|
|
|
BIN.SUFFIX = .exe
|
|
|
|
|
|
|
|
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
|
|
|
LIB.DEVLNK = lib$(NAME).so
|
|
|
|
LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION)
|
|
|
|
LIB.STATIC = lib$(NAME).a
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
2003-08-11 18:27:41 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
2003-09-25 23:30:52 +00:00
|
|
|
# Linux
|
|
|
|
# ----------------------------------------------------------------------------
|
2003-04-04 18:13:58 +00:00
|
|
|
ifeq ($(patsubst Linux%,Linux,$(SYSTEM)), Linux)
|
2003-09-25 23:30:52 +00:00
|
|
|
NAME = GLEW
|
2003-07-06 15:01:13 +00:00
|
|
|
CC = cc
|
2003-09-26 12:13:38 +00:00
|
|
|
LD = ld
|
2003-09-25 23:30:52 +00:00
|
|
|
CFLAGS.EXTRA =
|
2003-09-26 12:24:46 +00:00
|
|
|
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
|
|
|
|
LDFLAGS.EXTRA = -L/usr/X11R6/lib
|
2003-09-26 14:45:00 +00:00
|
|
|
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
|
2003-04-04 18:13:58 +00:00
|
|
|
NAME = GLEW
|
2003-09-25 23:30:52 +00:00
|
|
|
WARN = -Wall -W
|
|
|
|
BIN.SUFFIX =
|
|
|
|
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
|
|
|
LIB.DEVLNK = lib$(NAME).so
|
|
|
|
LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION)
|
|
|
|
LIB.STATIC = lib$(NAME).a
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
else
|
2003-08-11 18:27:41 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
2003-09-25 23:30:52 +00:00
|
|
|
# Irix
|
|
|
|
# ----------------------------------------------------------------------------
|
2003-07-06 15:01:13 +00:00
|
|
|
ifeq ($(patsubst IRIX%,IRIX,$(SYSTEM)), IRIX)
|
2003-09-25 23:30:52 +00:00
|
|
|
NAME = GLEW
|
2003-07-06 15:01:13 +00:00
|
|
|
CC = cc
|
2003-09-26 12:13:38 +00:00
|
|
|
LD = ld
|
2003-09-26 16:07:24 +00:00
|
|
|
ABI = -64# -n32
|
|
|
|
CC += $(ABI)
|
|
|
|
LD += $(ABI)
|
2003-09-26 16:12:10 +00:00
|
|
|
CFLAGS.EXTRA =
|
2003-09-26 12:24:46 +00:00
|
|
|
LDFLAGS.SO = -shared -soname $(LIB.SONAME)
|
2003-09-26 16:07:24 +00:00
|
|
|
LDFLAGS.EXTRA =
|
|
|
|
LDFLAGS.GL = -lGL -lXext -lX11
|
2003-07-06 15:01:13 +00:00
|
|
|
NAME = GLEW
|
2003-09-26 16:12:10 +00:00
|
|
|
WARN = -fullwarn -woff 1110,1498
|
2003-09-25 23:30:52 +00:00
|
|
|
BIN.SUFFIX =
|
2003-09-26 16:07:24 +00:00
|
|
|
LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR)
|
|
|
|
LIB.DEVLNK = lib$(NAME).so
|
|
|
|
LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION)
|
|
|
|
LIB.STATIC = lib$(NAME).a
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
2003-08-11 18:27:41 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
2003-09-25 23:30:52 +00:00
|
|
|
# Darwin
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin)
|
|
|
|
NAME = GLEW
|
|
|
|
CC = cc
|
2003-09-26 12:13:38 +00:00
|
|
|
LD = cc
|
2003-09-26 12:24:46 +00:00
|
|
|
CFLAGS.EXTRA = -dynamic -I/usr/X11R6/include
|
|
|
|
LDFLAGS.SO = -dynamiclib
|
|
|
|
LDFLAGS.EXTRA = -L/usr/X11R6/lib
|
2003-10-27 01:06:34 +00:00
|
|
|
ifdef GLEW_APPLE_GLX
|
|
|
|
CFLAGS.EXTRA += -D'GLEW_APPLE_GLX'
|
2003-09-26 14:45:00 +00:00
|
|
|
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
|
2003-10-27 01:06:34 +00:00
|
|
|
else
|
|
|
|
LDFLAGS.GL = -framework AGL -lGL
|
|
|
|
endif
|
2003-09-25 23:30:52 +00:00
|
|
|
NAME = GLEW
|
|
|
|
BIN.SUFFIX =
|
|
|
|
WARN = -Wall -W
|
|
|
|
LIB.SONAME = lib$(NAME).$(GLEW_MAJOR).dylib
|
|
|
|
LIB.DEVLNK = lib$(NAME).dylib
|
|
|
|
LIB.SHARED = lib$(NAME).$(GLEW_VERSION).dylib
|
|
|
|
LIB.STATIC = lib$(NAME).a
|
|
|
|
|
|
|
|
else
|
|
|
|
# ----------------------------------------------------------------------------
|
2003-04-04 18:13:58 +00:00
|
|
|
$(error "Platform '$(SYSTEM)' not supported")
|
|
|
|
endif
|
|
|
|
endif
|
2003-07-06 15:01:13 +00:00
|
|
|
endif
|
2003-09-26 12:13:38 +00:00
|
|
|
endif
|
2003-04-04 18:13:58 +00:00
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
AR = ar
|
|
|
|
INSTALL = install
|
|
|
|
RM = rm -f
|
|
|
|
LN = ln -sf
|
2003-04-04 18:13:58 +00:00
|
|
|
ifeq ($(MAKECMDGOALS), debug)
|
|
|
|
OPT = -g
|
2003-07-06 15:01:13 +00:00
|
|
|
STRIP =
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
2003-09-25 23:30:52 +00:00
|
|
|
OPT = -O2
|
2003-07-06 15:01:13 +00:00
|
|
|
STRIP = -s
|
2003-04-04 18:13:58 +00:00
|
|
|
endif
|
2002-12-13 08:31:58 +00:00
|
|
|
INCLUDE = -Iinclude
|
2003-09-25 23:30:52 +00:00
|
|
|
CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
LIB.SRCS = src/glew.c
|
|
|
|
LIB.OBJS = $(LIB.SRCS:.c=.o)
|
2003-09-26 13:56:24 +00:00
|
|
|
LIB.LDFLAGS = $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
2003-07-06 15:01:13 +00:00
|
|
|
LIB.LIBS = $(GL_LDFLAGS)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-09-25 23:30:52 +00:00
|
|
|
BIN = glewinfo$(BIN.SUFFIX)
|
2002-12-13 08:31:58 +00:00
|
|
|
BIN.SRCS = src/glewinfo.c
|
|
|
|
BIN.OBJS = $(BIN.SRCS:.c=.o)
|
2003-09-26 13:56:24 +00:00
|
|
|
BIN.LIBS = -Llib -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
2003-08-11 19:03:03 +00:00
|
|
|
|
2003-09-26 14:45:00 +00:00
|
|
|
all debug: lib/$(LIB.SHARED) lib/$(LIB.STATIC) bin/$(BIN)
|
2003-04-04 18:13:58 +00:00
|
|
|
|
2003-08-11 19:03:03 +00:00
|
|
|
lib:
|
|
|
|
mkdir lib
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-08-11 19:03:03 +00:00
|
|
|
lib/$(LIB.STATIC): $(LIB.OBJS)
|
2003-04-04 18:13:58 +00:00
|
|
|
$(AR) cr $@ $^
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-08-11 19:03:03 +00:00
|
|
|
lib/$(LIB.SHARED): $(LIB.OBJS)
|
2003-09-26 12:24:46 +00:00
|
|
|
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
2003-08-11 19:03:03 +00:00
|
|
|
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
|
|
|
|
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
bin/$(BIN): $(BIN.SRCS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(BIN.LIBS)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
2003-07-06 19:27:40 +00:00
|
|
|
src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
2002-12-13 08:31:58 +00:00
|
|
|
install: all
|
2003-07-06 15:01:13 +00:00
|
|
|
# directories
|
|
|
|
$(INSTALL) -d -m 0755 $(GLEW_DEST)/bin
|
|
|
|
$(INSTALL) -d -m 0755 $(GLEW_DEST)/include/GL
|
|
|
|
$(INSTALL) -d -m 0755 $(GLEW_DEST)/lib
|
|
|
|
# runtime
|
2003-08-11 19:03:03 +00:00
|
|
|
$(INSTALL) $(STRIP) -m 0644 lib/$(LIB.SHARED) $(GLEW_DEST)/lib/
|
|
|
|
$(LN) $(LIB.SHARED) $(GLEW_DEST)/lib/$(LIB.SONAME)
|
2003-07-06 15:01:13 +00:00
|
|
|
# development files
|
2003-07-06 20:21:50 +00:00
|
|
|
$(INSTALL) -m 0644 include/GL/wglew.h $(GLEW_DEST)/include/GL
|
|
|
|
$(INSTALL) -m 0644 include/GL/glew.h $(GLEW_DEST)/include/GL
|
|
|
|
$(INSTALL) -m 0644 include/GL/glxew.h $(GLEW_DEST)/include/GL
|
2003-08-11 19:03:03 +00:00
|
|
|
$(INSTALL) $(STRIP) -m 0644 lib/$(LIB.STATIC) $(GLEW_DEST)/lib/
|
|
|
|
$(LN) $(LIB.SHARED) $(GLEW_DEST)/lib/$(LIB.DEVLNK)
|
2003-07-06 15:01:13 +00:00
|
|
|
# utilities
|
|
|
|
$(INSTALL) -s -m 0755 bin/$(BIN) $(GLEW_DEST)/bin/
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
uninstall:
|
2003-07-06 20:21:50 +00:00
|
|
|
$(RM) $(GLEW_DEST)/include/GL/wglew.h
|
|
|
|
$(RM) $(GLEW_DEST)/include/GL/glew.h
|
|
|
|
$(RM) $(GLEW_DEST)/include/GL/glxew.h
|
2003-08-11 19:03:03 +00:00
|
|
|
$(RM) $(GLEW_DEST)/lib/$(LIB.DEVLNK)
|
|
|
|
$(RM) $(GLEW_DEST)/lib/$(LIB.SONAME)
|
|
|
|
$(RM) $(GLEW_DEST)/lib/$(LIB.SHARED)
|
|
|
|
$(RM) $(GLEW_DEST)/lib/$(LIB.STATIC)
|
2003-05-04 19:54:07 +00:00
|
|
|
$(RM) $(GLEW_DEST)/bin/$(BIN)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
clean:
|
2003-07-06 15:01:13 +00:00
|
|
|
$(RM) $(LIB.OBJS)
|
2003-08-11 19:03:03 +00:00
|
|
|
$(RM) lib/$(LIB.STATIC) lib/$(LIB.SHARED) lib/$(LIB.DEVLNK) lib/$(LIB.SONAME) $(LIB.STATIC)
|
2003-07-06 15:01:13 +00:00
|
|
|
$(RM) $(BIN.OBJS) bin/$(BIN)
|
2003-07-06 19:27:40 +00:00
|
|
|
# Compiler droppings
|
|
|
|
$(RM) so_locations
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2003-10-03 06:28:55 +00:00
|
|
|
find . -name \*~ | xargs $(RM)
|
|
|
|
find . -name .\*.sw\? | xargs $(RM)
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
tardist:
|
|
|
|
$(RM) -r $(TARDIR)
|
|
|
|
mkdir $(TARDIR)
|
|
|
|
cp -a . $(TARDIR)
|
2003-07-06 19:27:40 +00:00
|
|
|
find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r
|
2003-07-06 15:01:13 +00:00
|
|
|
$(MAKE) -C $(TARDIR) distclean
|
|
|
|
$(MAKE) -C $(TARDIR)
|
|
|
|
$(MAKE) -C $(TARDIR) distclean
|
2003-07-06 19:27:40 +00:00
|
|
|
$(RM) -r $(TARDIR)/auto/registry
|
2003-07-06 15:01:13 +00:00
|
|
|
env GZIP=-9 tar -C `dirname $(TARDIR)` -cvzf $(TARBALL) `basename $(TARDIR)`
|
|
|
|
|
2003-07-06 19:27:40 +00:00
|
|
|
.PHONY: clean distclean tardist
|