# File Makefile
# Last edited by stolfi on Fri Sep  4 06:23:01 1987

KERMAC = \
    algmacros.tex \
    basicfontmacros.tex \
    bffontmacros.tex \
    bibmacros.tex \
    bifontmacros.tex \
    cmrtextmacros.tex \
    cmrmathmacros.tex \
    commonformat.tex \
    compatibility.tex \
    fontswitchmacros.tex \
    kernelmacros.tex \
    progmacros.tex \
    sbfontmacros.tex \
    scfontmacros.tex \
    searchmacros.tex \
    ssfontmacros.tex \
    tifontmacros.tex \
    ttfontmacros.tex 
    
PAPMAC = \
    paperstyle/parms/normal.tex \
    paperstyle/figuremacros.tex \
    paperstyle/footmacros.tex \
    paperstyle/insertmacros.tex \
    paperstyle/mfigmacros.tex \
    paperstyle/notemacros.tex \
    paperstyle/outputmacros.tex \
    paperstyle/refmacros.tex \
    paperstyle/sectionmacros.tex \
    paperstyle/theomacros.tex \
    paperstyle/titlemacros.tex 

OTHER = \
    geomacros.tex \
    kinemacros.tex \
    lettermacros.tex \
    matrixhacks.tex \
    portuguese.tex \
    quadmacros.tex \
    reportmacros.tex \
    twosidedmacros.tex \
    xrefmacros.tex \
    paperstyle/parms/doublespace.tex \
    paperstyle/parms/paste.tex \
    paperstyle/parms/review.tex \
    paperstyle/parms/demispace.tex \
    paperstyle/parms/mfig.tex \
    paperstyle/caps/cal.tex \
    paperstyle/caps/ss.tex \
    paperstyle/caps/rm.tex

AM10 = \
    amfonts/ambasic10fonts.tex \
    amfonts/ambf10fonts.tex \
    amfonts/ambi10fonts.tex \
    amfonts/amsb10fonts.tex \
    amfonts/amsc10fonts.tex \
    amfonts/amss10fonts.tex \
    amfonts/amti10fonts.tex \
    amfonts/amtitle10fonts.tex \
    amfonts/amtt10fonts.tex 

AM11 = \
    amfonts/ambasic11fonts.tex \
    amfonts/ambf11fonts.tex \
    amfonts/ambi11fonts.tex \
    amfonts/amsb11fonts.tex \
    amfonts/amsc11fonts.tex \
    amfonts/amss11fonts.tex \
    amfonts/amti11fonts.tex \
    amfonts/amtitle11fonts.tex \
    amfonts/amtt11fonts.tex 


CM10 = \
    cmfonts/cmbasic10fonts.tex \
    cmfonts/cmbf10fonts.tex \
    cmfonts/cmbi10fonts.tex \
    cmfonts/cmsb10fonts.tex \
    cmfonts/cmsc10fonts.tex \
    cmfonts/cmss10fonts.tex \
    cmfonts/cmti10fonts.tex \
    cmfonts/cmtitle10fonts.tex \
    cmfonts/cmtt10fonts.tex 

CM11 = \
    cmfonts/cmbasic11fonts.tex \
    cmfonts/cmbf11fonts.tex \
    cmfonts/cmbi11fonts.tex \
    cmfonts/cmsb11fonts.tex \
    cmfonts/cmsc11fonts.tex \
    cmfonts/cmss11fonts.tex \
    cmfonts/cmti11fonts.tex \
    cmfonts/cmtitle11fonts.tex \
    cmfonts/cmtt11fonts.tex 

CM12 = \
    cmfonts/cmbasic12fonts.tex \
    cmfonts/cmbf12fonts.tex \
    cmfonts/cmbi12fonts.tex \
    cmfonts/cmsb12fonts.tex \
    cmfonts/cmsc12fonts.tex \
    cmfonts/cmss12fonts.tex \
    cmfonts/cmti12fonts.tex \
    cmfonts/cmtitle12fonts.tex \
    cmfonts/cmtt12fonts.tex 

# CM14 = \
#     cmfonts/cmbasic14fonts.tex \
#     cmfonts/cmbf14fonts.tex \
#     cmfonts/cmbi14fonts.tex \
#     cmfonts/cmsb14fonts.tex \
#     cmfonts/cmsc14fonts.tex \
#     cmfonts/cmss14fonts.tex \
#     cmfonts/cmti14fonts.tex \
#     cmfonts/cmtitle14fonts.tex \
#     cmfonts/cmtt14fonts.tex 

CM14 = \
    cmfonts/cmbasic14fonts.tex \
    cmfonts/cmbf14fonts.tex \
    cmfonts/cmti14fonts.tex \
    cmfonts/cmtitle14fonts.tex \
    cmfonts/cmtt14fonts.tex  

all: formats tests myspell.hlist;

formats: \
  cm10fmt.fmt cm11fmt.fmt cm12fmt.fmt cm14fmt.fmt \
  am10fmt.fmt am11fmt.fmt \
  testfmt.fmt;

# formats: \
#   cm10fmt.fmt cm11fmt.fmt cm12fmt.fmt cm14fmt.fmt \
#   testfmt.fmt;

tests: ruler.d

spelldict: myspell.hlist;

myspell.hlist: spell-yes.words; \
  cat spell-yes.words | spellin /usr/dict/hlista > myspell.hlist

# Suffixes and suffix rules: # # # # # # # # # # # # # # # # # # # # #

.SUFFIXES:
.SUFFIXES: .tex .fmt .c .l

# Formats # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

am10fmt.fmt: $(KERMAC) $(PAPMAC) $(AM10) am10fmt.tex; \
  initex \\nonstopmode \\input am10fmt

am11fmt.fmt: $(KERMAC) $(PAPMAC) $(AM11) am11fmt.tex;\
  initex \\nonstopmode \\input am11fmt


cm10fmt.fmt: $(KERMAC) $(PAPMAC) $(CM10) cm10fmt.tex; \
  initex \\nonstopmode \\input cm10fmt

cm11fmt.fmt: $(KERMAC) $(PAPMAC) $(CM11) cm11fmt.tex;\
  initex \\nonstopmode \\input cm11fmt

cm12fmt.fmt: $(KERMAC) $(PAPMAC) $(CM12) cm12fmt.tex;\
  initex \\nonstopmode \\input cm12fmt

cm14fmt.fmt: $(KERMAC) $(PAPMAC) $(CM14) cm14fmt.tex;\
  initex \\nonstopmode \\input cm14fmt

testfmt.fmt: $(KERMAC) testfmt.tex; \
  initex \\nonstopmode \\input testfmt

# Tests  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

ruler.d: formats ruler.tex ; \
  texprint -family am -fontsize 10 $* && touch $*.d
