2004-02-01 20:03:26 +00:00
|
|
|
## Copyright (C) 2004, 2003 Marcelo E. Magallon <mmagallo[at]debian org>
|
|
|
|
## Copyright (C) 2004, 2003 Milan Ikits <milan ikits[at]ieee org>
|
|
|
|
##
|
|
|
|
## This program is distributed under the terms and conditions of the GNU
|
|
|
|
## General Public License Version 2 as published by the Free Software
|
|
|
|
## Foundation or, at your option, any later version.
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2003-09-12 03:50:22 +00:00
|
|
|
GLEW_MAJOR = 1
|
2004-12-29 05:43:35 +00:00
|
|
|
GLEW_MINOR = 3
|
|
|
|
GLEW_MICRO = 0
|
2003-09-12 03:50:22 +00:00
|
|
|
GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO)
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2003-09-12 03:50:22 +00:00
|
|
|
SHELL = bash
|
|
|
|
REGISTRY = registry
|
2004-02-01 18:13:05 +00:00
|
|
|
REGISTRY_URL = http://oss.sgi.com/projects/ogl-sample/registry/
|
2003-09-12 03:50:22 +00:00
|
|
|
BIN = bin
|
|
|
|
SRC = src
|
|
|
|
CORE = core
|
|
|
|
EXT = extensions
|
|
|
|
BLACKLIST = blacklist
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2003-09-12 03:50:22 +00:00
|
|
|
PARSE_SPEC = parse_spec.pl
|
2003-11-10 08:50:17 +00:00
|
|
|
SYSTEM = $(strip $(shell uname -s))
|
2003-09-12 03:50:22 +00:00
|
|
|
|
|
|
|
TOP = ..
|
|
|
|
I.DEST = $(TOP)/include/GL
|
|
|
|
S.DEST = $(TOP)/src
|
|
|
|
D.DEST = $(TOP)/doc
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2004-12-29 05:43:35 +00:00
|
|
|
TARGETS = $(I.DEST)/glew.h $(I.DEST)/wglew.h $(I.DEST)/glxew.h $(S.DEST)/glew_gl.c $(S.DEST)/glew_str.c $(S.DEST)/glew_wgl.c $(S.DEST)/glew_glx.c $(S.DEST)/glewinfo.c \
|
2003-09-15 15:35:32 +00:00
|
|
|
$(D.DEST)/glew.html $(D.DEST)/wglew.html $(D.DEST)/glxew.html
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
2003-09-15 15:35:32 +00:00
|
|
|
registry: $(REGISTRY)/.dummy
|
2003-07-06 15:01:13 +00:00
|
|
|
ext: $(EXT)/.dummy
|
|
|
|
|
|
|
|
$(REGISTRY)/.dummy: $(BIN)/update_registry.sh
|
2003-09-15 15:35:32 +00:00
|
|
|
$(BIN)/update_registry.sh $(REGISTRY) $(REGISTRY_URL)
|
2004-01-13 18:59:49 +00:00
|
|
|
head -6 $(REGISTRY)/ATI/texture_env_combine3.txt > tmp
|
|
|
|
tail +7 $(REGISTRY)/ATI/texture_env_combine3.txt | \
|
|
|
|
perl -e 's/ATI\_/GL\_ATI\_/g;' -p >> tmp
|
|
|
|
mv -f tmp $(REGISTRY)/ATI/texture_env_combine3.txt
|
2003-07-06 15:01:13 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(EXT)/.dummy: $(REGISTRY)/.dummy
|
2003-09-15 15:35:32 +00:00
|
|
|
rm -rf $(EXT)
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST)
|
2003-11-10 08:50:17 +00:00
|
|
|
ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin)
|
2004-02-05 23:14:59 +00:00
|
|
|
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
|
|
|
|
xargs -J % cp % $(EXT)
|
2003-11-10 08:50:17 +00:00
|
|
|
else
|
2004-02-05 23:14:59 +00:00
|
|
|
find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \
|
|
|
|
xargs cp --target-directory=$(EXT)
|
2003-11-10 08:50:17 +00:00
|
|
|
endif
|
2003-07-06 15:01:13 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(I.DEST)/glew.h: $(EXT)/.dummy
|
2003-07-06 15:05:35 +00:00
|
|
|
test -d $(I.DEST) || mkdir -p $(I.DEST)
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/glew_head.h $@
|
2004-02-01 19:21:36 +00:00
|
|
|
$(BIN)/make_header.pl GLAPIENTRY GL $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_header.pl GLAPIENTRY GL $(EXT)/GL_* >> $@
|
2004-05-09 09:02:12 +00:00
|
|
|
echo -e "/* ------------------------------------------------------------------------- */\n\n#if defined(GLEW_MX) && defined(_WIN32)\n#define GLEW_FUN_EXPORT\n#else\n#define GLEW_FUN_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@
|
|
|
|
echo -e "#if defined(GLEW_MX)\n#define GLEW_VAR_EXPORT\n#else\n#define GLEW_VAR_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@
|
|
|
|
echo -e "#if defined(GLEW_MX) && defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@
|
|
|
|
$(BIN)/make_struct_fun.pl GLEW_FUN_EXPORT $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@
|
2004-02-19 17:53:59 +00:00
|
|
|
echo -e "\n#if defined(GLEW_MX) && !defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
|
2004-05-09 09:02:12 +00:00
|
|
|
$(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@
|
2004-02-19 17:53:59 +00:00
|
|
|
echo -e "\n#ifdef GLEW_MX\n}; /* GLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
2004-05-09 09:02:12 +00:00
|
|
|
perl -e 's/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/' -pi $@
|
2004-02-01 18:13:05 +00:00
|
|
|
rm -f $@.bak
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_tail.h >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
$(I.DEST)/wglew.h: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/wglew_head.h $@
|
2004-02-01 19:21:36 +00:00
|
|
|
$(BIN)/make_header.pl WINAPI WGL $(EXT)/WGL_* >> $@
|
2004-02-19 17:53:59 +00:00
|
|
|
echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define WGLEW_EXPORT\n#else\n#define WGLEW_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#ifdef GLEW_MX\nstruct WGLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@
|
|
|
|
$(BIN)/make_struct_fun.pl WGLEW_EXPORT $(EXT)/WGL_* >> $@
|
|
|
|
$(BIN)/make_struct_var.pl WGLEW_EXPORT $(EXT)/WGL_* >> $@
|
|
|
|
echo -e "\n#ifdef GLEW_MX\n}; /* WGLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/wglew_tail.h >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
|
|
|
|
$(I.DEST)/glxew.h: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/glxew_head.h $@
|
2004-02-01 20:03:26 +00:00
|
|
|
$(BIN)/make_header.pl '' GLX $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_header.pl '' GLX $(EXT)/GLX_* >> $@
|
2004-02-19 17:53:59 +00:00
|
|
|
echo -e "/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define GLXEW_EXPORT\n#else\n#define GLXEW_EXPORT extern\n#endif /* GLEW_MX */" >> $@
|
2004-05-09 09:02:12 +00:00
|
|
|
$(BIN)/make_struct_fun.pl extern $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@
|
2004-02-19 17:53:59 +00:00
|
|
|
echo -e "\n#if defined(GLEW_MX)\nstruct GLXEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@
|
|
|
|
$(BIN)/make_struct_var.pl GLXEW_EXPORT $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@
|
|
|
|
echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@
|
2004-02-19 18:02:09 +00:00
|
|
|
perl -e 's/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glxew_tail.h >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/fix_OML_sync_control.sh $@
|
|
|
|
|
2004-12-29 05:43:35 +00:00
|
|
|
$(S.DEST)/glew_gl.c: $(EXT)/.dummy
|
|
|
|
cp -f $(SRC)/glew_gl_head.c $@
|
2004-12-29 07:24:49 +00:00
|
|
|
$(BIN)/make_def_fun.pl GL $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_def_fun.pl GL $(EXT)/GL_* >> $@
|
|
|
|
cat $(SRC)/glew_gl_fun.c >> $@
|
|
|
|
$(BIN)/make_def_var.pl GL $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_def_var.pl GL $(EXT)/GL_* >> $@
|
|
|
|
cat $(SRC)/glew_gl_var.c >> $@
|
2004-02-01 18:13:05 +00:00
|
|
|
$(BIN)/make_init.pl GL $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_init.pl GL $(EXT)/GL_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_gl_init.c >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/make_list.pl $(CORE)/GL_VERSION* | grep -v '\"GL_VERSION' >> $@
|
|
|
|
$(BIN)/make_list.pl $(EXT)/GL_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_gl_tail.c >> $@
|
|
|
|
perl -e "s/GLEW_VERSION_STRING/$(GLEW_MAJOR)\.$(GLEW_MINOR)\.$(GLEW_MICRO)/g" -pi $@
|
|
|
|
perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
|
|
|
|
rm -f $@.bak
|
|
|
|
|
|
|
|
$(S.DEST)/glew_wgl.c: $(EXT)/.dummy
|
|
|
|
cp -f $(SRC)/glew_wgl_head.c $@
|
|
|
|
$(BIN)/make_def.pl WGL $(EXT)/WGL_* >> $@
|
2004-12-29 07:24:49 +00:00
|
|
|
cat $(SRC)/glew_wgl_def.c >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
$(BIN)/make_init.pl WGL $(EXT)/WGL_* >> $@
|
|
|
|
cat $(SRC)/glew_wgl_init.c >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/make_list.pl $(EXT)/WGL_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_wgl_tail.c >> $@
|
|
|
|
rm -f $@.bak
|
|
|
|
|
|
|
|
$(S.DEST)/glew_glx.c: $(EXT)/.dummy
|
|
|
|
cp -f $(SRC)/glew_glx_head.c $@
|
2004-12-29 07:24:49 +00:00
|
|
|
$(BIN)/make_def_fun.pl GLX $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_def_fun.pl GLX $(EXT)/GLX_* >> $@
|
|
|
|
cat $(SRC)/glew_glx_fun.c >> $@
|
|
|
|
$(BIN)/make_def_var.pl GLX $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_def_var.pl GLX $(EXT)/GLX_* >> $@
|
|
|
|
cat $(SRC)/glew_glx_var.c >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
$(BIN)/make_init.pl GLX $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_init.pl GLX $(EXT)/GLX_* >> $@
|
|
|
|
cat $(SRC)/glew_glx_init.c >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@
|
|
|
|
$(BIN)/make_list.pl $(EXT)/GLX_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_glx_tail.c >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/fix_OML_sync_control.sh $@
|
2004-01-13 18:59:49 +00:00
|
|
|
rm -f $@.bak
|
2003-07-06 15:01:13 +00:00
|
|
|
|
2004-12-29 05:43:35 +00:00
|
|
|
$(S.DEST)/glew_str.c: $(EXT)/.dummy
|
|
|
|
cp -f $(SRC)/glew_str_head.c $@
|
|
|
|
$(BIN)/make_str.pl $(CORE)/GL_VERSION* $(EXT)/GL_* >> $@
|
|
|
|
cat $(SRC)/glew_str_wgl.c >> $@
|
|
|
|
$(BIN)/make_str.pl $(EXT)/WGL_* >> $@
|
|
|
|
cat $(SRC)/glew_str_glx.c >> $@
|
|
|
|
$(BIN)/make_str.pl $(CORE)/GLX_VERSION* $(EXT)/GLX_* >> $@
|
|
|
|
cat $(SRC)/glew_str_tail.c >> $@
|
|
|
|
# $(BIN)/fix_OML_sync_control.sh $@
|
|
|
|
# perl -e "s/GLEW_VERSION_STRING/$(GLEW_MAJOR)\.$(GLEW_MINOR)\.$(GLEW_MICRO)/g" -pi $@
|
|
|
|
# perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@
|
|
|
|
rm -f $@.bak
|
|
|
|
|
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
$(S.DEST)/glewinfo.c: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/glewinfo_head.c $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/make_info.pl $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_info.pl $(EXT)/GL_* >> $@
|
|
|
|
echo -e "#ifdef _WIN32\n" >> $@
|
|
|
|
$(BIN)/make_info.pl $(EXT)/WGL_* >> $@
|
|
|
|
echo -e "#else /* _UNIX */\n" >> $@
|
|
|
|
$(BIN)/make_info.pl $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_info.pl $(EXT)/GLX_* >> $@
|
|
|
|
echo -e "#endif /* _WIN32 */\n" >> $@
|
|
|
|
|
|
|
|
cat $(SRC)/glewinfo_gl.c >> $@
|
|
|
|
$(BIN)/make_info_list.pl $(CORE)/GL_VERSION* >> $@
|
|
|
|
$(BIN)/make_info_list.pl $(EXT)/GL_* >> $@
|
|
|
|
cat $(SRC)/glewinfo_wgl.c >> $@
|
|
|
|
$(BIN)/make_info_list.pl $(EXT)/WGL_* >> $@
|
|
|
|
cat $(SRC)/glewinfo_glx.c >> $@
|
|
|
|
$(BIN)/make_info_list.pl $(CORE)/GLX_VERSION* >> $@
|
|
|
|
$(BIN)/make_info_list.pl $(EXT)/GLX_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glewinfo_tail.c >> $@
|
2003-07-06 15:01:13 +00:00
|
|
|
$(BIN)/fix_OML_sync_control.sh $@
|
|
|
|
|
2003-07-08 16:43:30 +00:00
|
|
|
$(D.DEST)/glew.html: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/glew_head.html $@
|
2003-07-08 16:43:30 +00:00
|
|
|
$(BIN)/make_html.pl $(EXT)/GL_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_tail.html >> $@
|
2003-07-08 16:43:30 +00:00
|
|
|
|
|
|
|
$(D.DEST)/wglew.html: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/wglew_head.html $@
|
2003-07-08 16:43:30 +00:00
|
|
|
$(BIN)/make_html.pl $(EXT)/WGL_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_tail.html >> $@
|
2003-07-08 16:43:30 +00:00
|
|
|
|
|
|
|
$(D.DEST)/glxew.html: $(EXT)/.dummy
|
2004-12-29 05:43:35 +00:00
|
|
|
cp -f $(SRC)/glxew_head.html $@
|
2003-07-08 16:43:30 +00:00
|
|
|
$(BIN)/make_html.pl $(EXT)/GLX_* >> $@
|
2004-12-29 05:43:35 +00:00
|
|
|
cat $(SRC)/glew_tail.html >> $@
|
2003-07-08 16:43:30 +00:00
|
|
|
|
2003-07-06 15:01:13 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(TARGETS)
|
|
|
|
rm -rf $(EXT)
|
|
|
|
|
|
|
|
clobber: clean
|
|
|
|
rm -rf $(REGISTRY)
|