2002-12-13 08:31:58 +00:00
|
|
|
## The OpenGL Extension Wrangler Library
|
2003-05-01 18:42:38 +00:00
|
|
|
## Copyright (C) 2003, 2002, Milan Ikits
|
|
|
|
## Copyright (C) 2002, Lev Povalahev
|
|
|
|
## 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
|
|
|
|
|
|
|
GLEW_TARGET ?= /usr
|
2003-05-01 18:42:37 +00:00
|
|
|
GLEW_VERSION = 1.0.6
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
SYSTEM = $(strip $(shell uname -s))
|
|
|
|
|
|
|
|
ifeq ($(patsubst CYGWIN%,CYGWIN,$(SYSTEM)), CYGWIN)
|
2003-05-01 23:40:22 +00:00
|
|
|
CC = \gcc -mno-cygwin
|
|
|
|
LD = \gcc -mno-cygwin
|
2003-04-04 18:13:58 +00:00
|
|
|
NAME = glew32
|
|
|
|
DEFINE = -D'GLEW_STATIC'
|
2003-05-01 23:40:22 +00:00
|
|
|
BIN.LIBS = -Llib -lglut -l$(NAME) -lglu32 -lopengl32
|
|
|
|
P.BIN = .exe
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
|
|
|
ifeq ($(patsubst Linux%,Linux,$(SYSTEM)), Linux)
|
|
|
|
CC = \gcc
|
2002-12-13 08:31:58 +00:00
|
|
|
LD = \ld
|
2003-04-04 18:13:58 +00:00
|
|
|
NAME = GLEW
|
2003-05-01 23:40:22 +00:00
|
|
|
BIN.LIBS = -Llib -L/usr/X11R6/lib -lglut -l$(NAME) -lGLU -lGL -lXmu -lX11
|
|
|
|
P.BIN =
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
|
|
|
$(error "Platform '$(SYSTEM)' not supported")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
AR = \ar
|
2002-12-13 08:31:58 +00:00
|
|
|
INSTALL = \install
|
|
|
|
RM = \rm -f
|
2003-05-01 20:14:25 +00:00
|
|
|
LN = \ln -fs
|
2003-04-04 18:13:58 +00:00
|
|
|
ifeq ($(MAKECMDGOALS), debug)
|
|
|
|
OPT = -g
|
|
|
|
else
|
|
|
|
OPT = -O3 -fomit-frame-pointer
|
|
|
|
endif
|
2002-12-13 08:31:58 +00:00
|
|
|
INCLUDE = -Iinclude
|
2003-04-04 18:13:58 +00:00
|
|
|
CFLAGS = $(OPT) $(INCLUDE) $(DEFINE)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
LIB.A = lib$(NAME).a
|
|
|
|
LIB.SO = lib$(NAME).so.$(GLEW_VERSION)
|
|
|
|
LIB.SO.LNK = lib$(NAME).so
|
2002-12-13 08:31:58 +00:00
|
|
|
LIB.SRCS = src/glew.c
|
|
|
|
LIB.OBJS = $(LIB.SRCS:.c=.o)
|
|
|
|
|
2003-05-01 23:40:22 +00:00
|
|
|
BIN = glewinfo$(P.BIN)
|
2002-12-13 08:31:58 +00:00
|
|
|
BIN.SRCS = src/glewinfo.c
|
|
|
|
BIN.OBJS = $(BIN.SRCS:.c=.o)
|
2003-04-04 18:13:58 +00:00
|
|
|
|
2003-05-01 20:12:19 +00:00
|
|
|
all: bin/$(BIN) lib/$(LIB.SO)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
lib/$(LIB.A): $(LIB.OBJS)
|
|
|
|
$(AR) cr $@ $^
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-04-04 18:13:58 +00:00
|
|
|
lib/$(LIB.SO): $(LIB.OBJS)
|
|
|
|
$(LD) -shared -o $@ $^
|
2003-05-01 20:12:19 +00:00
|
|
|
$(LN) $(LIB.SO) lib/$(LIB.SO.LNK)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2003-05-01 20:12:19 +00:00
|
|
|
bin/$(BIN): $(BIN.SRCS) lib/$(LIB.A)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $< $(BIN.LIBS)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
install: all
|
|
|
|
$(INSTALL) -d -m 755 $(GLEW_TARGET)/include/GL
|
|
|
|
$(INSTALL) -m 644 include/GL/glew.h include/GL/glxew.h $(GLEW_TARGET)/include/GL
|
|
|
|
$(INSTALL) -d -m 755 $(GLEW_TARGET)/lib
|
2003-05-01 20:14:25 +00:00
|
|
|
$(INSTALL) -s -m 755 lib/$(LIB.A) $(GLEW_TARGET)/lib
|
2003-04-04 18:13:58 +00:00
|
|
|
$(INSTALL) -s -m 755 lib/$(LIB.SO) $(GLEW_TARGET)/lib
|
|
|
|
$(LN) $(GLEW_TARGET)/lib/$(LIB.SO) $(GLEW_TARGET)/lib/$(LIB.SO.LNK)
|
2002-12-13 08:31:58 +00:00
|
|
|
$(INSTALL) -d -m 755 $(GLEW_TARGET)/bin
|
2002-12-15 08:30:27 +00:00
|
|
|
$(INSTALL) -s -m 755 bin/$(BIN) $(GLEW_TARGET)/bin
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
$(RM) $(GLEW_TARGET)/include/GL/glew.h $(GLEW_TARGET)/include/GL/glxew.h
|
2003-04-04 18:13:58 +00:00
|
|
|
$(RM) $(GLEW_TARGET)/lib/$(LIB.SO.LNK) $(GLEW_TARGET)/lib/$(LIB.SO)
|
2002-12-15 08:30:27 +00:00
|
|
|
$(RM) $(GLEW_TARGET)/bin/$(BIN)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
clean:
|
2003-04-04 18:13:58 +00:00
|
|
|
$(RM) $(LIB.OBJS) lib/$(LIB.A) lib/$(LIB.SO) lib/$(LIB.SO.LNK) \
|
|
|
|
$(BIN.OBJS) bin/$(BIN)
|