2003-10-27 05:28:55 +00:00
|
|
|
#!gmake
|
2002-12-13 08:31:58 +00:00
|
|
|
## The OpenGL Extension Wrangler Library
|
2007-12-28 01:47:25 +00:00
|
|
|
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
|
|
|
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
2004-02-01 20:03:26 +00:00
|
|
|
## Copyright (C) 2002, Lev Povalahev
|
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
|
|
|
|
2005-01-05 20:19:03 +00:00
|
|
|
include config/version
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
SHELL = /bin/sh
|
2005-01-04 03:57:56 +00:00
|
|
|
SYSTEM = $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
|
2004-12-07 17:28:58 +00:00
|
|
|
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2004-12-07 17:28:58 +00:00
|
|
|
ifeq ($(SYSTEM.SUPPORTED), 1)
|
|
|
|
include config/Makefile.$(SYSTEM)
|
2003-04-04 18:13:58 +00:00
|
|
|
else
|
|
|
|
$(error "Platform '$(SYSTEM)' not supported")
|
|
|
|
endif
|
|
|
|
|
2007-03-02 15:14:23 +00:00
|
|
|
GLEW_DEST ?= /usr
|
2007-03-02 16:56:00 +00:00
|
|
|
BINDIR ?= $(GLEW_DEST)/bin
|
2007-03-02 15:14:23 +00:00
|
|
|
LIBDIR ?= $(GLEW_DEST)/lib
|
2007-03-02 16:56:00 +00:00
|
|
|
INCDIR ?= $(GLEW_DEST)/include/GL
|
2007-03-02 15:14:23 +00:00
|
|
|
SHARED_OBJ_EXT ?= o
|
|
|
|
TARDIR = ../glew-$(GLEW_VERSION)
|
|
|
|
TARBALL = ../glew_$(GLEW_VERSION).tar.gz
|
2004-11-14 02:34:30 +00:00
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
AR = ar
|
|
|
|
INSTALL = install
|
2007-09-28 19:07:02 +00:00
|
|
|
STRIP = strip
|
2003-07-06 15:01:13 +00:00
|
|
|
RM = rm -f
|
|
|
|
LN = ln -sf
|
2003-04-04 18:13:58 +00:00
|
|
|
ifeq ($(MAKECMDGOALS), debug)
|
|
|
|
OPT = -g
|
|
|
|
else
|
2003-10-27 05:28:55 +00:00
|
|
|
OPT = $(POPT)
|
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)
|
2004-12-06 07:52:55 +00:00
|
|
|
LIB.SOBJS = $(LIB.SRCS:.c=.$(SHARED_OBJ_EXT))
|
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
|
|
|
|
2004-06-17 16:33:39 +00:00
|
|
|
GLEWINFO.BIN = glewinfo$(BIN.SUFFIX)
|
|
|
|
GLEWINFO.BIN.SRCS = src/glewinfo.c
|
|
|
|
GLEWINFO.BIN.OBJS = $(GLEWINFO_BIN.SRCS:.c=.o)
|
|
|
|
VISUALINFO.BIN = visualinfo$(BIN.SUFFIX)
|
|
|
|
VISUALINFO.BIN.SRCS = src/visualinfo.c
|
|
|
|
VISUALINFO.BIN.OBJS = $(VISUALINFO_BIN.SRCS:.c=.o)
|
2007-03-01 07:09:30 +00:00
|
|
|
BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
2003-08-11 19:03:03 +00:00
|
|
|
|
2004-06-17 16:33:39 +00:00
|
|
|
all debug: lib/$(LIB.SHARED) lib/$(LIB.STATIC) bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.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
|
|
|
|
2004-11-14 02:34:30 +00:00
|
|
|
lib/$(LIB.SHARED): $(LIB.SOBJS)
|
2003-09-26 12:24:46 +00:00
|
|
|
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
2005-01-04 04:11:14 +00:00
|
|
|
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
2004-01-11 11:45:55 +00:00
|
|
|
else
|
2003-08-11 19:03:03 +00:00
|
|
|
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
|
|
|
|
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
|
2004-01-11 11:45:55 +00:00
|
|
|
endif
|
2002-12-13 08:31:58 +00:00
|
|
|
|
2006-11-21 04:12:47 +00:00
|
|
|
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.SRCS) lib/$(LIB.SHARED)
|
2007-03-01 07:09:30 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.SRCS) $(BIN.LIBS)
|
2004-06-17 16:33:39 +00:00
|
|
|
|
2006-11-21 04:12:47 +00:00
|
|
|
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.SRCS) lib/$(LIB.SHARED)
|
2007-03-01 07:09:30 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.SRCS) $(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
|
2004-01-11 11:45:55 +00:00
|
|
|
$(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
|
2003-07-06 19:27:40 +00:00
|
|
|
|
2004-11-14 02:34:30 +00:00
|
|
|
src/glew.pic_o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
|
|
|
|
$(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
|
|
|
|
|
2002-12-13 08:31:58 +00:00
|
|
|
install: all
|
2003-07-06 15:01:13 +00:00
|
|
|
# directories
|
2007-03-02 16:56:00 +00:00
|
|
|
$(INSTALL) -d -m 0755 $(BINDIR)
|
|
|
|
$(INSTALL) -d -m 0755 $(INCDIR)
|
2006-03-02 23:02:51 +00:00
|
|
|
$(INSTALL) -d -m 0755 $(LIBDIR)
|
2003-07-06 15:01:13 +00:00
|
|
|
# runtime
|
2005-01-04 04:11:14 +00:00
|
|
|
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
2007-09-28 19:07:02 +00:00
|
|
|
$(STRIP) -x lib/$(LIB.SHARED)
|
|
|
|
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(BINDIR)/
|
2004-01-11 11:45:55 +00:00
|
|
|
else
|
2007-09-28 19:07:02 +00:00
|
|
|
$(STRIP) -x lib/$(LIB.SHARED)
|
2006-03-02 23:02:51 +00:00
|
|
|
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/
|
|
|
|
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
|
2004-01-11 11:45:55 +00:00
|
|
|
endif
|
|
|
|
endif
|
2003-07-06 15:01:13 +00:00
|
|
|
# development files
|
2007-03-02 16:56:00 +00:00
|
|
|
$(INSTALL) -m 0644 include/GL/wglew.h $(INCDIR)/
|
|
|
|
$(INSTALL) -m 0644 include/GL/glew.h $(INCDIR)/
|
|
|
|
$(INSTALL) -m 0644 include/GL/glxew.h $(INCDIR)/
|
2005-01-04 04:11:14 +00:00
|
|
|
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
2006-03-02 23:02:51 +00:00
|
|
|
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
|
2004-01-11 11:45:55 +00:00
|
|
|
else
|
2004-01-05 23:29:14 +00:00
|
|
|
strip -x lib/$(LIB.STATIC)
|
2006-03-02 23:02:51 +00:00
|
|
|
$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
|
|
|
|
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
|
2004-01-11 11:45:55 +00:00
|
|
|
endif
|
2003-07-06 15:01:13 +00:00
|
|
|
# utilities
|
2007-03-02 16:56:00 +00:00
|
|
|
$(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
uninstall:
|
2007-03-02 16:56:00 +00:00
|
|
|
$(RM) $(INCDIR)/wglew.h
|
|
|
|
$(RM) $(INCDIR)/glew.h
|
|
|
|
$(RM) $(INCDIR)/glxew.h
|
2006-03-02 23:02:51 +00:00
|
|
|
$(RM) $(LIBDIR)/$(LIB.DEVLNK)
|
2005-01-04 04:11:14 +00:00
|
|
|
ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
|
2007-03-02 16:56:00 +00:00
|
|
|
$(RM) $(BINDIR)/$(LIB.SHARED)
|
2004-01-11 11:45:55 +00:00
|
|
|
else
|
2006-03-02 23:02:51 +00:00
|
|
|
$(RM) $(LIBDIR)/$(LIB.SONAME)
|
|
|
|
$(RM) $(LIBDIR)/$(LIB.SHARED)
|
|
|
|
$(RM) $(LIBDIR)/$(LIB.STATIC)
|
2004-01-11 11:45:55 +00:00
|
|
|
endif
|
2007-03-02 16:56:00 +00:00
|
|
|
$(RM) $(BINDIR)/$(GLEWINFO.BIN) $(BINDIR)/$(VISUALINFO.BIN)
|
2002-12-13 08:31:58 +00:00
|
|
|
|
|
|
|
clean:
|
2003-07-06 15:01:13 +00:00
|
|
|
$(RM) $(LIB.OBJS)
|
2004-11-14 02:34:30 +00:00
|
|
|
$(RM) $(LIB.SOBJS)
|
2003-08-11 19:03:03 +00:00
|
|
|
$(RM) lib/$(LIB.STATIC) lib/$(LIB.SHARED) lib/$(LIB.DEVLNK) lib/$(LIB.SONAME) $(LIB.STATIC)
|
2004-06-17 16:33:39 +00:00
|
|
|
$(RM) $(GLEWINFO.BIN.OBJS) bin/$(GLEWINFO.BIN) $(VISUALINFO.BIN.OBJS) bin/$(VISUALINFO.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)`
|
|
|
|
|
2004-01-13 07:15:59 +00:00
|
|
|
extensions:
|
|
|
|
$(MAKE) -C auto
|
|
|
|
|
2003-07-06 19:27:40 +00:00
|
|
|
.PHONY: clean distclean tardist
|