home *** CD-ROM | disk | FTP | other *** search
Makefile | 1994-02-02 | 4.0 KB | 179 lines |
- # My makefile for Rayce under linux
- # make srayce for a speedy version of rayce
- # make drayce for a gbd-debug version of rayce
- # make rayce for a plain version of rayce
- # make prayce for a gprof version of rayce
-
- #compiling for other platforms
- # set CC, YACC to the appropriate names, set the CFLAGS correct
- # Depending on your os, change the .o endings
-
- NICE=nice
- CFLAGS=-O -DDEBUG -c -Wall -ansi -Wunused
- LINKER=gcc
- CC=gcc
- YFLAGS=-d
- YACC=bison
- PARSFILE=rayparse.tab
- SYSFILE=linux
- LIBS=-lm
- OBEX=o
- LDFLAGS=
-
- #
- # MSDOS.
- #
-
- #SYSFILE=ibmtcc
- #PARSFILE=rayparse
- #LINKFL=-ml -erayce
- #LINKER=tcc
- #CC=tcc
- #BFLAGS=-d
- #YACC=bison
- #CFLAGS=-c -ml -w-cln
- #OBEX=obj
-
- # be careful. MS Dos truncates some names, such as initialize.c
-
- SRC= poly.c algebraic.c gif.c imagemap.c csg.c queue.c color.c \
- $(PARSFILE).c box.c composite.c lights.c token.c plane.c camera.c\
- object.c texture.c quadric.c sphere.c $(SYSFILE).c raymath.c\
- main.c trace.c intersect.c initialize.c bg.c shade.c\
- solve.c torus.c polygon.c superq.c extrusion.c triangle.c discs.c
-
- OBJ= poly.$(OBEX) algebraic.$(OBEX) gif.$(OBEX) \
- imagemap.$(OBEX) csg.$(OBEX) queue.$(OBEX) \
- color.$(OBEX) $(PARSFILE).$(OBEX)\
- box.$(OBEX) composite.$(OBEX) \
- lights.$(OBEX) token.$(OBEX)\
- plane.$(OBEX) camera.$(OBEX) \
- object.$(OBEX) texture.$(OBEX)\
- quadric.$(OBEX) sphere.$(OBEX) \
- $(SYSFILE).$(OBEX) raymath.$(OBEX) \
- main.$(OBEX) trace.$(OBEX) intersect.$(OBEX) \
- initialize.$(OBEX) shade.$(OBEX)\
- bg.$(OBEX) solve.$(OBEX) torus.$(OBEX)\
- polygon.$(OBEX) superq.$(OBEX) extrusion.$(OBEX) triangle.$(OBEX) discs.$(OBEX)
-
- # the basic rule
- rayce: $(OBJ)
- $(LINKER) $(LDFLAGS) -o rayce $(OBJ) $(LIBS)
-
- # speed version of rayce
- srayce: $(SRC) $(HDR)
- -rm rayce
- $(MAKE) CFLAGS='-c -O2 -fomit-frame-pointer -finline-functions -funroll-loops' rayce
- mv rayce srayce
-
- # rebuild for debugging.
- drayce: $(SRC) $(HDR)
- -rm rayce
- $(MAKE) CFLAGS='-DDEBUG -c -ggdb -Wall' rayce
- mv rayce drayce
-
- # for profiling. When you want it to work, install libc 4.5.8 and gcc 2.5.7
- prayce: $(SRC) $(HDR)
- -rm rayce
- $(MAKE) LDFLAGS='-pg' CFLAGS='-O2 -c -pg -finline-functions -funroll-loops' rayce
- mv rayce prayce
-
- # UT
- lint:
- mv rayce .foobarray
- $(MAKE) LDFLAGS='-S' CFLAGS='-ansi -pedantic \
- -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual\
- -Wenum-clash -Wcast-align -Wtraditional \
- -Wstrict-prototypes -Wmissing-prototypes \
- -Wredundant-decls -Wnested-externs \
- -Winline -Wshadow -S -o /dev/null' rayce
- mv .foobarray rayce
-
- # rebuild all execs.
- all:
- $(MAKE) clean
- $(MAKE) back
- $(MAKE) srayce
- rm *.o
- $(MAKE) prayce
- rm *.o
- $(MAKE) rayce
-
- # crucial headers.
- HDR=ray.h extern.h
-
- $(OBJ): $(HDR)
-
-
- # produce nice distributable source files.
- rebuild:
- etags *.[ch]
- cformat *.[ch]
-
-
- clean:
- -rm *.o core.* *~ #* gmon.out rayparse.output
-
- realclean:
- -rm *.o [spd]rayce rayce core.* *~ #* gmon.out rayparse.output
-
- back:
- -rm *~
- zip -u ~/backs/rayce *.[chyr] README* MANIFEST*.doc ?akefile* *.inc
-
-
-
- # note on messydog systems, output of bison will be called
- # rayparse.y and rayparse.h
-
- #is an implicit rule in gnu make, but just to be on the safe side
- .c.$(OBEX):
- $(NICE) $(CC) $(CFLAGS) $*.c
-
- $(PARSFILE).c: rayparse.y
- $(YACC) $(YFLAGS) rayparse.y
-
- token.o: rayparse.y
-
- ############################################################
- ## Shipping. You probably don't need this, but I do.
- ############################################################
-
- ARCHIVER=zip
- VER=27
- SCNARC=rayce$(VER)d.zip
- SRCARC=rayce$(VER)s.zip
- DOSBIN=rayce$(VER)x.zip
-
- ship: $(SCNARC) $(SRCARC) #$(DOSBIN)
-
- #scenes + docs
- $(SCNARC): *.doc
- -rm $(SCNARC)
- cp file_id.diz.d file_id.diz
- $(ARCHIVER) $(SCNARC) file_id.diz `cat MANIFEST.doc`
-
-
- #sources
- $(SRCARC): $(SRC) *.h MANIFEST.src
- mv rayparse.tab.c tmp.tab.c
- $(MAKE) rebuild
- -rm $(SRCARC)
- cp file_id.diz.s file_id.diz
- -$(ARCHIVER) $(SRCARC) file_id.diz `cat MANIFEST.src`
- mv tmp.tab.c rayparse.tab.c
-
- #dos exec
- $(DOSBIN): /doshd/graf/ray/rayce.exe
- -rm $(DOSBIN)
- cp file_id.diz.x file_id.diz
- $(ARCHIVER) -j $(DOSBIN) file_id.diz /doshd/graf/ray/rayce.exe
-
-
-
-
-
-
-
-
-