# The LameTeX Makefile

# Make the correct directories for the following.
# 
EXEC = /cs/src/lametex/src/lametex
SRCDIR = /cs/src/lametex/src/
PAGEDIR = /cs/src/lametex/page/

# Below should be the command that on your system transforms a file
# lametex.tex into a file lametex.dvi. Use your version of LaTeX for this.
# You MUST put \040 in place of the space character. For example,
# "latex lametex.tex"        turns into        "latex\040lametex.tex"
LATEX = latex\040lametex.tex

# Below should be the command that on your system transforms a file
# lametex.dvi into a file lametex.ps. Use your version of dvips for this.
# You MUST put \040 in place of the space character. For example,
# "dvips lametex.dvi -o"     turns into     "dvips\040lametex.dvi\040-o"
DVIPS = dvips\040lametex.dvi\040-o

# List of other libraries the test files use
LDFLAGS =

### List of include directories to look for file included with #include<..>
INC =


C++FLAGS = -g -DPAGEDIR=\"${PAGEDIR}\" -DSRCDIR=\"${SRCDIR}\" \
	 '-DDVIPS="${DVIPS}"' '-DLATEX="${LATEX}"'

# Choose the appropriate C++ compiler and make sure the pathname is correct
#CC = /pro/mia/bin/CC-3.0.1 -DATT_CC30 -D_CC30 $(C++FLAGS)
#CC = /cs/bin/gcc $(C++FLAGS)
#CC = /cs/bin/g++ $(C++FLAGS)
#CC = /usr/lang/CC $(C++FLAGS)
CC = /cs/bin/CC $(C++FLAGS)

### Command to compile a .C file into a .o file
CCC = $(CC) $(DEFINES) -c $(INC)

### Command to compile a .C file into an executable
CCL = $(CC) $(LDFLAGS)

all : lametex

### How to make a .C file into a .o file if it has a .h file
%.o :: %.C
	$(CCC) $<

### How to make a .C file into a .o file if it does not have a .h file
%.o :: %.C
	$(CCC) $<

### main program

lametex_objs = LameTeX.o FileInput.o Token.o Stack.o Environment.o \
	Operator.o Counter.o Document.o Font.o Justify.o Length.o Label.o

lametex : $(lametex_objs)
	$(CCL) -o $(EXEC) $(lametex_objs) $(LIBS)