Commit de0ee318 authored by Brian Paul's avatar Brian Paul

New Makefile system

parent a70ad912
This diff is collapsed.
# progs/Makefile
TOP = ..
include $(TOP)/configs/current
SUBDIRS = $(PROGRAM_DIRS)
default: $(TOP)/configs/current
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
pushd $$dir ; \
make ; \
popd ; \
fi \
done
clean:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
pushd $$dir ; \
make clean; \
popd ; \
fi \
done
# progs/demos/Makefile
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
OSMESA_LIBS = -L$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(LIB_DIR)/$(GL_LIB) $(LIB_DIR)/$(GLU_LIB) $(LIB_DIR)/$(GLUT_LIB)
PROGS = \
arbfplight \
arbocclude \
bounce \
clearspd \
cubemap \
drawpix \
fire \
fplight \
gamma \
gears \
geartrain \
glinfo \
gloss \
gltestperf \
glutfx \
isosurf \
ipers \
lodbias \
morph3d \
multiarb \
occlude \
osdemo \
paltex \
pixeltex \
pointblast \
ray \
readpix \
reflect \
renormal \
shadowtex \
spectex \
spriteblast \
stex3d \
teapot \
terrain \
tessdemo \
texcyl \
texdown \
texenv \
texobj \
trispd \
tunnel \
tunnel2 \
winpos
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
# make executable from .c file:
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
##### TARGETS #####
default: readtex.c readtex.h $(PROGS)
clean:
-rm -f *.o *~
realclean:
-rm -f $(PROGS)
-rm -f *.o *~
-rm -f readtex.[ch]
readtex.c:
cp $(TOP)/progs/util/readtex.c .
readtex.h:
cp $(TOP)/progs/util/readtex.h .
# special case: need the -lOSMesa library:
osdemo: osdemo.c
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
# Makefile for miniglx demo programs
TOP = ../..
include $(TOP)/configs/current
SOURCES = miniglxtest.c \
miniglxsample.c \
sample_server.c \
sample_server2.c \
manytex.c \
texline.c
OBJECTS = $(SOURCES:.c=.o)
PROGS = $(SOURCES:%.c=%)
INCLUDES = \
-I. \
-I$(TOP)/include
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c:
$(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
##### TARGETS #####
default: depend $(PROGS)
clean:
rm -f $(PROGS)
rm -f *.o
depend: $(SOURCES)
touch depend
makedepend -fdepend -Y $(INCLUDES) $(SOURCES) >& /dev/null
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
include depend
# progs/redbook/Makefile
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIB_DEP = $(LIB_DIR)/$(GL_LIB) $(LIB_DIR)/$(GLU_LIB) $(LIB_DIR)/$(GLUT_LIB)
PROGS = aaindex aapoly aargb accanti accpersp alpha alpha3D anti \
bezcurve bezmesh checker clip colormat cube depthcue dof \
double drawf feedback fog fogindex font hello image light \
lines list material mipmap model movelight nurbs pickdepth \
picksquare plane planet polyoff polys quadric robot sccolorlight \
scene scenebamb sceneflat select smooth stencil stroke surface \
teaambient teapots tess tesswind texbind texgen texprox texsub \
texturesurf torus trim unproject varray wrap
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
##### TARGETS ######
default: $(PROGS)
clean:
-rm -f *.o *~
realclean:
-rm -f $(PROGS)
-rm -f *.o *~
# progs/samples/Makefile
TOP = ../..
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIB_DEP = $(LIB_DIR)/$(GL_LIB) $(LIB_DIR)/$(GLU_LIB) $(LIB_DIR)/$(GLUT_LIB)
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
font line logo nurb oglinfo olympic overlay point prim quad select \
shape sphere star stencil stretch texture tri wave
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
##### TARGETS #####
default: $(PROGS)
clean:
-rm -f *.o *~
realclean:
-rm -f $(PROGS)
-rm -f *.o *~
# progs/xdemos/Makefile
TOP = ../../
include $(TOP)/configs/current
INCDIR = $(TOP)/include
LIBS = -L$(LIB_DIR) $(APP_LIB_DEPS)
LIB_DEP = $(LIB_DIR)/$(GL_LIB) $(LIB_DIR)/$(GLU_LIB)
PROGS = glthreads \
glxdemo \
glxgears \
glxheads \
glxinfo \
glxpixmap \
glxpbdemo \
glxswapcontrol \
manywin \
offset \
pbinfo \
pbdemo \
wincopy \
xdemo \
xfont \
xrotfontdemo
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) $(CFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
default: $(PROGS)
clean:
-rm -f *.o *~
realclean:
-rm -f $(PROGS)
-rm -f *.o *~
# special cases
pbinfo: pbinfo.o pbutil.o
$(CC) pbinfo.o pbutil.o $(LIBS) -o $@
pbdemo: pbdemo.o pbutil.o
$(CC) pbdemo.o pbutil.o $(LIBS) -o $@
pbinfo.o: pbinfo.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c
pbdemo.o: pbdemo.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbdemo.c
pbutil.o: pbutil.c pbutil.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
$(CC) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c
xrotfontdemo.o: xrotfontdemo.c xuserotfont.h
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) xrotfontdemo.c
# src/Makefile
TOP = ..
include $(TOP)/configs/current
SUBDIRS = $(SRC_DIRS)
default: $(LIB_DIR) subdirs
subdirs:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
pushd $$dir ; \
make ; \
popd ; \
fi \
done
$(LIB_DIR):
-mkdir $(LIB_DIR)
clean:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
pushd $$dir ; \
make clean ; \
popd ; \
fi \
done
# src/glu/Makefile
TOP = ../..
include $(TOP)/configs/current
SUBDIRS = $(GLU_DIRS)
default: $(TOP)/configs/current
@for dir in $(SUBDIRS) ; do \
pushd $$dir ; \
make ; \
popd ; \
done
clean:
@for dir in $(SUBDIRS) ; do \
pushd $$dir ; \
make clean; \
popd ; \
done
# src/glu/sgi/Makefile
TOP = ../../..
include $(TOP)/configs/current
GLU_MAJOR = 1
GLU_MINOR = 3
GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
INCDIRS = -I$(TOP)/include -Iinclude -Iinternals -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
C_SOURCES = \
libutil/error.c \
libutil/glue.c \
libutil/mipmap.c \
libutil/project.c \
libutil/quad.c \
libutil/registry.c \
libtess/dict.c \
libtess/geom.c \
libtess/memalloc.c \
libtess/mesh.c \
libtess/normal.c \
libtess/priorityq.c \
libtess/render.c \
libtess/sweep.c \
libtess/tess.c \
libtess/tessmono.c
CC_SOURCES = \
libnurbs/interface/bezierEval.cc \
libnurbs/interface/bezierPatch.cc \
libnurbs/interface/bezierPatchMesh.cc \
libnurbs/interface/glcurveval.cc \
libnurbs/interface/glinterface.cc \
libnurbs/interface/glrenderer.cc \
libnurbs/interface/glsurfeval.cc \
libnurbs/interface/incurveeval.cc \
libnurbs/interface/insurfeval.cc \
libnurbs/internals/arc.cc \
libnurbs/internals/arcsorter.cc \
libnurbs/internals/arctess.cc \
libnurbs/internals/backend.cc \
libnurbs/internals/basiccrveval.cc \
libnurbs/internals/basicsurfeval.cc \
libnurbs/internals/bin.cc \
libnurbs/internals/bufpool.cc \
libnurbs/internals/cachingeval.cc \
libnurbs/internals/ccw.cc \
libnurbs/internals/coveandtiler.cc \
libnurbs/internals/curve.cc \
libnurbs/internals/curvelist.cc \
libnurbs/internals/curvesub.cc \
libnurbs/internals/dataTransform.cc \
libnurbs/internals/displaylist.cc \
libnurbs/internals/flist.cc \
libnurbs/internals/flistsorter.cc \
libnurbs/internals/hull.cc \
libnurbs/internals/intersect.cc \
libnurbs/internals/knotvector.cc \
libnurbs/internals/mapdesc.cc \
libnurbs/internals/mapdescv.cc \
libnurbs/internals/maplist.cc \
libnurbs/internals/mesher.cc \
libnurbs/internals/monoTriangulationBackend.cc \
libnurbs/internals/monotonizer.cc \
libnurbs/internals/mycode.cc \
libnurbs/internals/nurbsinterfac.cc \
libnurbs/internals/nurbstess.cc \
libnurbs/internals/patch.cc \
libnurbs/internals/patchlist.cc \
libnurbs/internals/quilt.cc \
libnurbs/internals/reader.cc \
libnurbs/internals/renderhints.cc \
libnurbs/internals/slicer.cc \
libnurbs/internals/sorter.cc \
libnurbs/internals/splitarcs.cc \
libnurbs/internals/subdivider.cc \
libnurbs/internals/tobezier.cc \
libnurbs/internals/trimline.cc \
libnurbs/internals/trimregion.cc \
libnurbs/internals/trimvertpool.cc \
libnurbs/internals/uarray.cc \
libnurbs/internals/varray.cc \
libnurbs/nurbtess/directedLine.cc \
libnurbs/nurbtess/gridWrap.cc \
libnurbs/nurbtess/monoChain.cc \
libnurbs/nurbtess/monoPolyPart.cc \
libnurbs/nurbtess/monoTriangulation.cc \
libnurbs/nurbtess/partitionX.cc \
libnurbs/nurbtess/partitionY.cc \
libnurbs/nurbtess/polyDBG.cc \
libnurbs/nurbtess/polyUtil.cc \
libnurbs/nurbtess/primitiveStream.cc \
libnurbs/nurbtess/quicksort.cc \
libnurbs/nurbtess/rectBlock.cc \
libnurbs/nurbtess/sampleComp.cc \
libnurbs/nurbtess/sampleCompBot.cc \
libnurbs/nurbtess/sampleCompRight.cc \
libnurbs/nurbtess/sampleCompTop.cc \
libnurbs/nurbtess/sampleMonoPoly.cc \
libnurbs/nurbtess/sampledLine.cc \
libnurbs/nurbtess/searchTree.cc
SOURCES = $(C_SOURCES) $(CC_SOURCES)
C_OBJECTS = $(C_SOURCES:.c=.o)
CC_OBJECTS = $(CC_SOURCES:.cc=.o)
OBJECTS = $(C_OBJECTS) $(CC_OBJECTS)
##### RULES #####
.c.o:
$(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
.cc.o:
$(CXX) -c $(INCDIRS) $(CXXFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
##### TARGETS #####
default: $(LIB_DIR)/$(GLU_LIB_NAME)
# Make the library:
$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
$(TOP)/bin/mklib -o $(GLU_LIB) -major $(GLU_MAJOR) \
-minor $(GLU_MINOR) -patch $(GLU_TINY) \
-cplusplus $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLU_LIB_DEPS) $(OBJECTS)
clean:
-rm -f *.o */*.o */*/*.o
-rm -f *.lo */*.lo */*/*.lo
-rm -f *.la */*.la */*/*.la
# Makefile for GLUT
#
# NOTICE: The OpenGL Utility Toolkit (GLUT) distribution contains source
# code published in a book titled "Programming OpenGL for the X Window
# System" (ISBN: 0-201-48359-9) published by Addison-Wesley. The
# programs and associated files contained in the distribution were
# developed by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark
# J. Kilgard (unless otherwise noted). The programs are not in the
# public domain, but they are freely distributable without licensing
# fees. These programs are provided without guarantee or warrantee
# expressed or implied.
#
# GLUT source included with Mesa with permission from Mark Kilgard.
TOP = ../../..
include $(TOP)/configs/current
##### MACROS #####
GLUT_MAJOR = 3
GLUT_MINOR = 7
GLUT_TINY = 1
SOURCES = \
glut_8x13.c \
glut_9x15.c \
glut_bitmap.c \
glut_bwidth.c \
glut_cindex.c \
glut_cmap.c \
glut_cursor.c \
glut_dials.c \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fbc.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
glut_glxext.c \
glut_hel10.c \
glut_hel12.c \
glut_hel18.c \
glut_init.c \
glut_input.c \
glut_joy.c \
glut_key.c \
glut_keyctrl.c \
glut_keyup.c \
glut_menu.c \
glut_menu2.c \
glut_mesa.c \
glut_modifier.c \
glut_mroman.c \
glut_overlay.c \
glut_roman.c \
glut_shapes.c \
glut_space.c \
glut_stroke.c \
glut_swap.c \
glut_swidth.c \
glut_tablet.c \
glut_teapot.c \
glut_tr10.c \
glut_tr24.c \
glut_util.c \
glut_vidresize.c \
glut_warp.c \
glut_win.c \
glut_winmisc.c \
layerutil.c
OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c -I$(TOP)/include $(CFLAGS) $(GLUT_CFLAGS) $<
##### TARGETS #####
default: $(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)
clean:
-rm -f *.o *~
-rm -f *.lo
-rm -f *.la
-rm -rf .libs
depend: $(SOURCES)
touch depend
makedepend -fdepend -Y -I$(TOP)/include $(SOURCES)
include depend
# subset glut
TOP = ../../..
include $(TOP)/configs/current
MARK = $(TOP)/src/glut/glx
GLUT_MAJOR = 3
GLUT_MINOR = 7
GLUT_TINY = 1
INCLUDES = -I$(TOP)/include -I$(MARK)
CORE_SOURCES = \
bitmap.c \
callback.c \
color.c \
globals.c \
init.c \
menu.c \
models.c \
overlay.c \
state.c \
teapot.c \
window.c
MARK_SOURCES = \
$(MARK)/glut_8x13.c \
$(MARK)/glut_9x15.c \
$(MARK)/glut_hel10.c \
$(MARK)/glut_hel12.c \
$(MARK)/glut_hel18.c \
$(MARK)/glut_tr10.c \
$(MARK)/glut_tr24.c
SOURCES = $(CORE_SOURCES) $(MARK_SOURCES)
OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
default: depend $(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
$(TOP)/bin/mklib -o $(GLUT_LIB) \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(GLUT_LIB_DEPS) -install $(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)
# Run 'make -f Makefile.solo dep' to update the dependencies if you change
# what's included by any source file.
depend: $(SOURCES)
touch depend
makedepend -fdepend -Y $(INCLUDES) $(SOURCES) >& /dev/null
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
# Remove .o and backup files
clean: depend
-rm -f depend
-rm -f *.o *~ *.o *~ *.so libglut.so.3.7
include depend
include Makefile.X11
# src/glw/Makefile
TOP = ../..
include $(TOP)/configs/current
MAJOR = 1
MINOR = 0
TINY = 0
INCDIRS = -I$(TOP)/include -I/usr/include/Motif1.2 -I/usr/contrib/X11R6/include -I/usr/X11R6/include
OBJECTS = $(GLW_SOURCES:.c=.o)
##### RULES #####