Kinda. If you use -Fs
it’ll find both *.t
(T3 source) and *.tl
(T3 library) files.
So for example I’m putting together a little module that implements simple random maps (n x n square of rooms with random connections) for testing purposes. A map:
/home/tads/git/simpleRandomMap/
./demo/
./games/
makefile.t3m
./obj/
./src/
sample.t
./doc/
LICENSE.txt
simpleRandomMap.h
simpleRandomMap.t
simpleRandomMap.tl
So the main module code is in /home/tads/git/simpleRandomMap/
and the test cases (in this case only one) live in ./demo/
, with the makefile being ./demo/makefile.t3m
and the source for the test case in ./demo/src/sample.t
.
The expectation is that t3make
will be run from the ./demo/
directory.
The basic makefile looks like:
-D LANGUAGE=en_us
-D MESSAGESTYLE=neu
-Fy obj -Fo obj
-o games/game.t3
-lib system
-lib adv3/adv3
-lib ../simpleRandomMap
-source src/sample.t
Going more or less line-by-line:
-D LANGUAGE=en_us
-D MESSAGESTYLE=neu
These are standard preprocessor flags for language settings.
-Fy obj -Fo obj
Tells the complier to output object (-Fo
) and symbol (-Fy
) files to the obj
directory. Since we’re going to be running t3make
from /home/tads/git/simpleRandomMap/demo/
, that means symbol and object files will end up in /home/tads/git/simpleRandomMap/demo/obj/
.
-o games/game.t3
This tells t3make
to write the compiled story file to the ./games/
subdirectory. Which, again assuming we’re compiling from /home/tads/git/simpleRandomMap/demo/
, means the story file will end up as /home/tads/git/simpleRandomMap/demo/games/game.t3
.
-lib system
-lib adv3/adv3
Tells the compiler to load the system.tl
and adv3/adv3.tl
from somewhere in the search path. For my FrobTADS install, that’s /usr/local/share/frobtads/tads3/
, so the loaded versions will be /usr/local/share/frobtads/tads3/lib/system.tl
and /usr/local/share/frobtads/tads3/lib/adv3/adv3.tl
. Note that you can specify a different system library path via -FL [path]
at compile time, if you want/need to.
-lib ../simpleRandomMap
This tells the compiler to look for simpleRandomMap.tl
in ..
. And because we’re compiling from /home/tads/git/simpleRandomMap/demo/
, it’ll look in /home/tads/git/simpleRandomMap/demo/../simpleRandomMap.tl
, or (equivalently) /home/tads/git/simpleRandomMap/simpleRandomMap.tl
.
-source src/sample.t
Finally, we look for the source we’re compiling in ./src/sample.t
. Compiling from /home/tads/git/simpleRandomMap/demo/
this will be /home/tads/git/simpleRandomMap/demo/src/sample.t
.
Right. Now let’s say we want to include an external module. I frequently add my debugTool
module to projects I’m working on to help with debugging. Following the same standard layout, the debugTool
module lives in /home/tads/git/debugTool/
.
So to update the simpleRandomMap
makefile discussed above to include this module, we can just add
-lib ../../debugTool/debugTool
Compiling from /home/tads/git/simpleRandomMap/demo/
this will look for debugTool.tl
in /home/tads/git/simpleRandomMap/demo/../../debugTool/debugTool.tl
, which is to say /home/tads/git/debugTool/debugTool.tl
, which is what we need.
Alternately we could add:
-Fs ../../
…to tell the compiler to add ../../
to the search path. If we’re compiling from /home/tads/git/simpleRandomMap/demo/
that’s going to work out to be /home/tads/git/
. So then we can just add:
-lib debugTool/debugTool
Note that the order of options matters, and you have to put all the “F” options (like -Fs
) before any -lib
or -source
options. So the final makefile could look something like:
#
# simpleRandomMap.t3m
#
# Preprocessor flags
-D LANGUAGE=en_us
-D MESSAGESTYLE=neu
#
# Path options
-Fy obj -Fo obj
-Fs ../../
#
# Story file location
-o games/game.t3
#
# System libraries
-lib system
-lib adv3/adv3
#
# Contrib libraries
-lib debugTool/debugTool
#
# This module
-lib ../simpleRandomMap
#
# The demo code
-source src/sample.t