2002-12-13 08:31:58 +00:00
|
|
|
## The OpenGL Extension Wrangler Library
|
|
|
|
## Copyright (C) 2002 Milan Ikits
|
|
|
|
##
|
|
|
|
## This library is free software; you can redistribute it and/or
|
|
|
|
## modify it under the terms of the GNU Lesser General Public
|
|
|
|
## License as published by the Free Software Foundation; either
|
|
|
|
## version 2.1 of the License, or (at your option) any later version.
|
|
|
|
##
|
|
|
|
## This library is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
## Lesser General Public License for more details.
|
|
|
|
##
|
|
|
|
## You should have received a copy of the GNU Lesser General Public
|
|
|
|
## License along with this library; if not, write to the Free Software
|
|
|
|
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
|
|
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)
|
|
|
|
CC = \gcc-2 -mno-cygwin
|
|
|
|
LD = \gcc-2 -mno-cygwin
|
|
|
|
NAME = glew32
|
|
|
|
DEFINE = -D'GLEW_STATIC'
|
|
|
|
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
|
|
|
|
else
|
|
|
|
$(error "Platform '$(SYSTEM)' not supported")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
AR = \ar
|
2002-12-13 08:31:58 +00:00
|
|
|
INSTALL = \install
|
|
|
|
RM = \rm -f
|
2002-12-15 08:30:27 +00:00
|
|
|
LN = \ln -s
|
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)
|
|
|
|
|
2002-12-15 08:30:27 +00:00
|
|
|
BIN = glewinfo
|
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
|
|
|
BIN.LIBS = -Llib -L/usr/X11R6/lib -lglut -l$(NAME) -lGLU -lGL -lXmu -lX11
|
|
|
|
|
|
|
|
all: lib/$(LIB.A) bin/$(BIN)
|
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 $@ $^
|
2002-12-15 08:30:27 +00:00
|
|
|
$(LN) $(LIB) lib/$(LIB.LNK)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2002-12-15 08:30:27 +00:00
|
|
|
bin/$(BIN): $(BIN.SRCS)
|
2002-12-13 08:31:58 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(BIN.LIBS)
|
|
|
|
|
|
|
|
%.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-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)
|