Makefile and comments on qbsp/vis/light
Thu, 27 Jun 1996 02:18:17 +0200 (MET DST)

Date: Thu, 27 Jun 1996 02:18:17 +0200 (MET DST)
Message-Id: <>
Subject: Makefile and comments on qbsp/vis/light

I saw Joost's message just when I was about to go back home, and I
immediately started ftp and downloaded the source code provided by
John Carmack. I also downloaded Quake, because I had not tried the
shareware version yet due to lack of time and other "real life"
constraints. :-)

I had to re-write the Makefile, but once I did that, everything
compiled correctly. I tried that under Solaris 2.5 on a SparcStation
20, but this should work with most UN*X systems. Since my Makefile is
small and could be useful for other people, I included it at the end
of this message. I hope that nobody will complain...

A few random comments:
- dm1.bsp, which is included in the archive, is the good old test1.bsp
It works fine if you save it in .../id1/maps/dm1.bsp and load it
by typing "map dm1" in the console.
- You'd better have a machine with lots of memory in order to run
qbsp. Fortunately, this wasn't a problem for my workstation. For
example, running qbsp on took 65 Mb of memory after a few
seconds. If your machine has less than 64 Mb of RAM, it will
probably swap all the time.
- qbsp crashed with a bus error after 5 minutes and dumped a rather
large core file (66 Mb). I don't have the time to check what was
wrong. Anyway, qbsp will never be able to finish if it cannot
find the textures that are referenced in the map file (these should
be loaded from "gfx/medieval.wad"). Errrmm... Well, actually I
can rebuild "medieval.wad" from the textures included in the bsp
file using QEU 0.4, but I don't think this is morally right.
- in cmdlib.c, I had to modify line 504 and replace:
#ifdef _SGI_SOURCE
#if defined(_BIG_ENDIAN) || defined(__sun) || defined(sparc) || defined (__sgi)
Otherwise, the endianness would not be correct on a SparcStation
(the line above is the same as the one I use in GAEL and QEU; tell
me if that doesn't work for some systems).
- light and vis take a lot less memory than qbsp. Running light on
dm1.bsp took one minute and a half, and vis took eight minutes
(with the default options, no optimisations, on a single processor).
Your mileage may vary...

Here is the modified Makefile:

---------- cut here ---------- cut here --------- cut here ----------
# Makefile for building the Quake tools "qbsp", "light", "vis", ...
# Works fine with GNU make and gcc under Solaris 2.5, should also work
# for most UN*X systems. Change "CC" and "CFLAGS" as appropriate.

CC = gcc

CFLAGS = -g -Wall
# CFLAGS = -O3 -ffast-math -mv8

EXES = qbsp light vis bspinfo entmap

all: $(EXES)

/bin/rm -f *.o $(EXES)

QBSPOBJS = region.o map.o brush.o cmdlib.o csg4.o surfaces.o \
mathlib.o merge.o outside.o portals.o qbsp.o \
solidbsp.o tjunc.o writebsp.o bspfile.o nodraw.o
qbsp : $(QBSPOBJS)
$(CC) -o qbsp $(QBSPOBJS) -lm

LIGHTOBJS = threads.o bspfile.o cmdlib.o light.o ltface.o \
mathlib.o trace.o entities.o
light : $(LIGHTOBJS)
$(CC) -o light $(LIGHTOBJS) -lm

VISOBJS = vis.o flow.o cmdlib.o mathlib.o bspfile.o \
vis : $(VISOBJS)
$(CC) -o vis $(VISOBJS) -lm

BSPIOBJS = bspinfo.o bspfile.o cmdlib.o
bspinfo : $(BSPIOBJS)
$(CC) -o bspinfo $(BSPIOBJS) -lm

ENTMOBJS = entmap.o cmdlib.o
entmap : $(ENTMOBJS)
$(CC) -o entmap $(ENTMOBJS)

---------- cut here ---------- cut here --------- cut here ----------

Have fun!


P.S.: If you send a mail to me, don't expect a reply before next week.
I'm too busy with my regular job for the moment and the two hours
that I just spent on qbsp will not help my projects... :-/