#!gmake # # License Applicability. Except to the extent portions of this file are # made subject to an alternative license as permitted in the SGI Free # Software License B, Version 1.1 (the "License"), the contents of this # file are subject only to the provisions of the License. You may not use # this file except in compliance with the License. You may obtain a copy # of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 # Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: # # http://oss.sgi.com/projects/FreeB # # Note that, as provided in the License, the Software is distributed on an # "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS # DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND # CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A # PARTICULAR PURPOSE, AND NON-INFRINGEMENT. # # Original Code. The Original Code is: OpenGL Sample Implementation, # Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, # Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. # Copyright in any portions created by third parties is as indicated # elsewhere herein. All Rights Reserved. # # Additional Notice Provisions: The application programming interfaces # established by SGI in conjunction with the Original Code are The # OpenGL(R) Graphics System: A Specification (Version 1.2.1), released # April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version # 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X # Window System(R) (Version 1.3), released October 19, 1998. This software # was created using the OpenGL(R) version 1.2.1 Sample Implementation # published by SGI, but has not been independently verified as being # compliant with the OpenGL(R) version 1.2.1 Specification. # # $Date$ $Revision$ # $Header: //depot/main/glx/server/GNUmakefile#13 $ COMMONPREF = standard include $(ROOT)/usr/include/make/commondefs GEN_HFILES = \ g_disptab.h \ g_disptab_EXT.h \ $(NULL) GEN_CFILES = \ g_disptab.c \ g_disptab_EXT.c \ g_render.c \ g_renderswap.c \ g_single.c \ g_singleswap.c \ $(NULL) CFILES = \ global.c \ glxbuf.c \ glxcmds.c \ glxcmdsswap.c \ glxext.c \ glxfb.c \ glximports.c \ glxmem.c \ glxmodule.c \ glxpix.c \ glxscreens.c \ glxutil.c \ render2.c \ render2swap.c \ renderpix.c \ renderpixswap.c \ rensize.c \ rensizetab.c \ single2.c \ single2swap.c \ singlepix.c \ singlepixswap.c \ singlesize.c \ xfont.c \ $(GEN_CFILES) \ $(NULL) AUTOGEN_TXT = "/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */" LIBNAME = libdixGL.a # This must be set to match the extension defines in your X server tree, # because some server internal structure are configured depending on what # extensions are supported. EXT_DEFINES = -DSHAPE -DMULTIBUFFER -DMITMISC -DXTEST -DMITSHM \ -DXINPUT -DNMBX -DSPEECH -DREADDISPLAY -DSGIMISC \ -DScreenSaverExtension -DXV -DXTRAP=32 #if defined(R5BUILD) && ($(R5BUILD) == "YES") BLD_DEFINES = -DX11R5 #endif ifeq ($(OS),Linux) BLD_DEFINES = -DXF86 endif LCDEFS = $(EXT_DEFINES) $(BLD_DEFINES) ARFLAGS = r # Set XTOPDIR to point to your X server tree. $ROOT/usr/include # is included here because we don't want to pick up the headers in # mit/extensions/include/GL # XXX Todo: parameterize so the correct LINCS is defined, depending on # style of X tree used #if defined(R5BUILD) && ($(R5BUILD) == "YES") LCINCS = -I. -I$(ROOT)/usr/include -I$(XTOPDIR)/mit/include \ -I$(XTOPDIR)/mit/extensions/include -I$(XTOPDIR)/mit/server/include \ -I$(XTOPDIR)/mit/fonts/include #else LCINCS = -I. -I$(ROOT)/usr/include -I$(XTOPDIR)/xc/include \ -I$(XTOPDIR)/xc/include/extensions -I$(XTOPDIR)/xc/include/fonts \ -I$(XTOPDIR)/xc/programs/Xserver/include \ -I$(XTOPDIR)/xc/exports/include #endif ifeq ($(OS),Linux) LCINCS += -I$(XTOPDIR)/xc/programs/Xserver/hw/xfree86/ endif LCINCS += -I../include # define this if 64 bit things require aligned addresses LCOPTS += -D__GLX_ALIGN64 LDIRT = tabhelp.awk TARGETS = $(GEN_HFILES) $(GEN_CFILES) tabhelp.awk $(LIBNAME) default libs: $(GEN_HFILES) $(MAKE) $(LIBNAME) headers headers_install apps: libs_install install: default $(INSTALL) -F $(ROOT)/usr/lib $(LIBNAME) distsi: $(GEN_HFILES) $(GEN_CFILES) $(MAKE) $(COMMONPREF)$@ distoss: $(MAKE) $(COMMONPREF)$@ $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) ###################################################################### HEADDIR = $(TOPDIR)/gfx/include include $(ROOT)/usr/include/libspec/libspecdefs # Where to find things used by the generation rules below DISPATCHUTIL = ../lib/listutil.ls DISPATCHGEN = lexec.ls TABLEGEN = ./disptab.ls TABLEHELPGEN = ./tabhelp.ls g_render.c: $(SPECDIR)/$(GL_SPEC) $(TYPEMAPSDIR)/$(C_TYPEMAP) $(DISPATCHGEN) \ $(DISPATCHUTIL) $(LIBSPEC_CUTILS) $(OSSCOPYRIGHT) rm -f $@ $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ cat $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) > $@.tmp.ls $(LIBSPEC) $(CHECKFLAG) -DTYPEMAP="$(C_TYPEMAP)" \ -DFUNCS="transdraw" \ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ "$(SPECDIR)/$(GL_SPEC)" >> $@ rm $@.tmp.ls g_renderswap.c: $(SPECDIR)/$(GL_SPEC) $(TYPEMAPSDIR)/$(C_TYPEMAP) \ $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) \ $(OSSCOPYRIGHT) rm -f $@ $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ cat $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) > $@.tmp.ls $(LIBSPEC) $(CHECKFLAG) -DTYPEMAP="$(C_TYPEMAP)" \ -DFUNCS="transdraw" -DSWAP="yes" \ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ "$(SPECDIR)/$(GL_SPEC)" >> $@ rm $@.tmp.ls g_single.c: $(SPECDIR)/$(GL_SPEC) $(TYPEMAPSDIR)/$(C_TYPEMAP) \ $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) $(OSSCOPYRIGHT) rm -f $@.tmp.ls $@ cat $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) > $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ $(LIBSPEC) $(CHECKFLAG) -DTYPEMAP="$(C_TYPEMAP)" \ -DFUNCS="transget" \ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ "$(SPECDIR)/$(GL_SPEC)" >> $@ rm $@.tmp.ls g_singleswap.c: $(SPECDIR)/$(GL_SPEC) $(TYPEMAPSDIR)/$(C_TYPEMAP) \ $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) \ $(OSSCOPYRIGHT) rm -f $@.tmp.ls $@ cat $(DISPATCHGEN) $(DISPATCHUTIL) $(LIBSPEC_CUTILS) > $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ $(LIBSPEC) $(CHECKFLAG) -DTYPEMAP="$(C_TYPEMAP)" \ -DFUNCS="transget" -DSWAP="yes" \ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ "$(SPECDIR)/$(GL_SPEC)" >> $@ rm $@.tmp.ls # # Generate the dispatch table and prototypes. # tabhelp.awk: $(SPECDIR)/$(GL_SPEC) $(SPECDIR)/$(GLX_SPEC) $(TABLEHELPGEN) \ $(DISPATCHUTIL) rm -f $@ $@.tmp.ls cat $(TABLEHELPGEN) $(DISPATCHUTIL) > $@.tmp.ls rm -f glxgl.spec.tmp cat $(SPECDIR)/$(GLX_SPEC) $(SPECDIR)/$(GL_SPEC) > glxgl.spec.tmp echo "# GENERATED FILE, MEANT TO BE INSERTED INTO ANOTHER SCRIPT" >> $@ $(LIBSPEC) $(CHECKFLAG) -DFUNCS=single -T $(TYPEMAPSDIR) \ -P $(LIBSPEC_PARSER) $@.tmp.ls glxgl.spec.tmp >> $@ $(LIBSPEC) $(CHECKFLAG) -DFUNCS=vendpriv -DSUFFIX=_EXT\ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ $(SPECDIR)/$(GL_SPEC) >> $@ $(LIBSPEC) $(CHECKFLAG) -DFUNCS=render \ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ $(SPECDIR)/$(GL_SPEC) >> $@ $(LIBSPEC) $(CHECKFLAG) -DFUNCS=render -DSUFFIX=_EXT\ -T $(TYPEMAPSDIR) -P $(LIBSPEC_PARSER) $@.tmp.ls \ $(SPECDIR)/$(GL_SPEC) >> $@ rm $@.tmp.ls rm -f glxgl.spec.tmp g_disptab.c: tabhelp.awk $(TABLEGEN) rm -f $@ $@.tmp.ls echo "function TableHelper() {" >> $@.tmp.ls cat tabhelp.awk >> $@.tmp.ls echo "}" >> $@.tmp.ls cat $(TABLEGEN) >> $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ awk -f $@.tmp.ls -v OUTPUT=tables /dev/null >> $@ rm -f $@.tmp.ls g_disptab_EXT.c: tabhelp.awk $(TABLEGEN) rm -f $@ $@.tmp.ls echo "function TableHelper() {" >> $@.tmp.ls cat tabhelp.awk >> $@.tmp.ls echo "}" >> $@.tmp.ls cat $(TABLEGEN) >> $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ awk -f $@.tmp.ls -v OUTPUT=tables -v SUFFIX=_EXT /dev/null >> $@ rm -f $@.tmp.ls g_disptab.h: tabhelp.awk $(TABLEGEN) rm -f $@ $@.tmp.ls echo "function TableHelper() {" >> $@.tmp.ls cat tabhelp.awk >> $@.tmp.ls echo "}" >> $@.tmp.ls cat $(TABLEGEN) >> $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ echo "#ifndef _GLX_g_disptab_h_" >> $@ echo "#define _GLX_g_disptab_h_" >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ awk -f $@.tmp.ls -v OUTPUT=prototypes /dev/null >> $@ echo "#endif /* _GLX_g_disptab_h_ */" >> $@ rm -f $@.tmp.ls g_disptab_EXT.h: tabhelp.awk $(TABLEGEN) rm -f $@ $@.tmp.ls echo "function TableHelper() {" >> $@.tmp.ls cat tabhelp.awk >> $@.tmp.ls echo "}" >> $@.tmp.ls cat $(TABLEGEN) >> $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ echo "#ifndef _GLX_g_disptab_EXT_h_" >> $@ echo "#define _GLX_g_disptab_EXT_h_" >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ awk -f $@.tmp.ls -v OUTPUT=prototypes -v SUFFIX=_EXT /dev/null >> $@ echo "#endif /* _GLX_g_disptab_EXT_h_ */" >> $@ rm -f $@.tmp.ls g_rensizetab.c: tabhelp.awk $(TABLEGEN) rm -f $@ $@.tmp.ls echo "function TableHelper() {" >> $@.tmp.ls cat tabhelp.awk >> $@.tmp.ls echo "}" >> $@.tmp.ls cat $(TABLEGEN) >> $@.tmp.ls echo $(AUTOGEN_TXT) >> $@ awk 'BEGIN { print "/*" }; { print "**", $$0 }; END { print "*/\n"}' \ $(OSSCOPYRIGHT) >> $@ awk -f $@.tmp.ls -v OUTPUT=rensizes /dev/null >> $@ awk -f $@.tmp.ls -v OUTPUT=rensizes -v SUFFIX=_EXT /dev/null >> $@ rm -f $@.tmp.ls include $(COMMONRULES) $(COMMONTARGS): % : $(COMMONPREF)%