home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
cz
/
part04
/
Makefile
< prev
next >
Wrap
Makefile
|
1989-10-01
|
7KB
|
378 lines
# Makefile - main GNU make file for cz
#
# $Header: Makefile,v 1.18 89/09/23 17:00:19 howard Exp $
#
# Copyright 1989 Howard Lee Gayle
# This file is written in the ISO 8859/1 character set.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 1,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include MakeCommon
# Commands:
# Binary file encoder.
ABE=abe
# Put a file into the distribution directory.
DISTO=mkDistO
# Echo arguments.
ECHO=echo
# Elisp compiler.
ELCMP=emacs -batch -q -f batch-byte-compile
# Install a non-executable file.
INSTF=mkInstF
# Install an executable file.
INSTX=mkInstX
# Lint command.
LINT=lint
# Make shar files.
SHAR=makekit
# Spelling-check LaTeX source.
SPELL_LATEX=mkSpellLT
# Command options:
# Make files immune to IBM.
ABEFLAGS=+ebcdic
# Set commands at start of Bourne shell files, usually absolute paths.
BDEFS='l=lpr'
# C compiler options.
CFLAGS=-O4
# C library search path.
LIBPATH=-L/usr/local/free/howard/0
# C libraries to link in.
LIBES=-lhoward -lm
# Options to lint.
LINTFLAGS=-abchux
# Lint libraries.
LL=/usr/local/free/howard/0/llib-howard.ln
# Directories:
# Install Bourne shell files here.
BID=../bin
# Install C executables here.
CID=../bin
# Install encoding files here.
CODEID=../lib
# Install compiled elisp here.
ELID=../el
# Install man entries here.
MID=../man
# Install .ps files here.
PSID=../lib
# Install .rc files here. This must be an absolute path.
RCID=/usr/local/free/cz/2/lib
# Install test texts here.
TID=../test
# Install test PostScript files here.
TPSID=../test
# Install trigram tables here.
TTID=../lib
# Sources:
# Bourne shell files.
BS := $(filter %.b,$(SRCS))
# BibTeX bibliography file.
BIBS := $(filter %.bib,$(SRCS))
# Encoding files.
CODES:=$(filter %.code,$(SRCS))
# C programs.
CS := $(filter %.c,$(SRCS))
# Elisp source.
ELS := $(filter %.el,$(SRCS))
# Frequency tables.
FRS := $(filter %.fr,$(SRCS))
# C include files.
HS := $(filter %.h,$(SRCS))
# LaTeX source.
LATEXS := $(filter %.tex,$(SRCS))
# Manuals.
M1S := $(filter %.1,$(SRCS))# Section 1.
ms := $(M1S)
# M4 macro processor sources. (Not manual entries for section 4.)
M4S := $(filter %.m4,$(SRCS))
# M4 that will turn into PostScript.
P4S := $(filter %.p4,$(SRCS))
# Cz command files.
RCS := $(filter %.rc,$(SRCS))
# Test PostScript files.
TPSS := $(filter %.ps,$(SRCS))
# Test texts.
TS = 8859-1.t 8859-1-fox.t T-61.t char8-dec.t char8-hex.t char8-oct.t
# All ordinary source files. Removed by make clobber.
src := $(BS) $(BIBS) $(CODES) $(CS) $(ELS) $(FRS) $(HS) \
$(ms) $(M4S) $(P4S) $(RCS) $(LATEXS) $(TPSS) $(TS)
# Absolutely all source files.
allsrc := README FREEZE MakeCommon Makefile uMakefile $(src)
# Targets and installs:
# Bourne shell files.
bt := $(subst .b,,$(BS))
bi := $(patsubst %,$(BID)/%,$(bt))
# C programs.
ct := $(subst .c,,$(CS))
ci := $(patsubst %,$(CID)/%,$(ct))
lt := $(patsubst %.c,%-l,$(CS))# Phony lint targets for C programs.
st := $(subst .c,.s,$(CS))# Assembler targets for C programs.
# Encoding files.
codei := $(patsubst %,$(CODEID)/%,$(CODES))
# Compiled elisp.
elt := $(subst .el,.elc,$(ELS))
eli := $(patsubst %,$(ELID)/%,$(elt))
# LaTeX.
ifdef FMTLATEX
latext := $(subst .tex,.texf,$(LATEXS))
spellt := $(patsubst %.tex,%-s,$(LATEXS))#Phony targets for spelling checking.
endif
# Manual entries.
cat1i := $(patsubst %,$(MID)/cat1/%,$(M1S))
m1i := $(patsubst %,$(MID)/man1/%,$(M1S))
cati := $(cat1i)
mi := $(m1i)
# Formatted manual entries, e.g. PostScript.
ifdef FMTMAN
ft := $(patsubst %,%.f,$(ms))
endif
# PostScript from M4.
pst := $(subst .p4,.ps,$(P4S))
psi := $(patsubst %,$(PSID)/%,$(pst))
# Control files.
rci := $(patsubst %,$(RCID)/%,$(RCS))
# Test text.
ti := $(patsubst %,$(TID)/%,$(TS))
# Test PostScript.
tpsi := $(patsubst %,$(TPSID)/%,$(TPSS))
# Trigram tables.
ttt = dkus.tt seus.tt
tti := $(patsubst %,$(TTID)/%,$(ttt))
targets := $(bt) $(ct) $(elt) $(ft) $(latext) $(pst) $(RCS) $(TPSS) $(TS) $(ttt)
# Distribution:
dist := $(patsubst %,$(DD)/%,$(allsrc) $(ft) $(latext))
# Don't use built-in rules.
.SUFFIXES:
.PHONY: clean clobber default dist install shar vars $(lt) $(spellt)
default: $(targets)
vars:
@$(ECHO) 'SRCS:' $(SRCS)
@$(ECHO) 'BS:' $(BS)
@$(ECHO) 'CS:' $(CS)
@$(ECHO) 'CZS:' $(CZS)
@$(ECHO) 'ELS:' $(ELS)
@$(ECHO) 'HS:' $(HS)
@$(ECHO) 'M1S:' $(M1S)
@$(ECHO) 'P4S:' $(P4S)
@$(ECHO) 'RCS:' $(RCS)
@$(ECHO) 'allsrc:' $(allsrc)
@$(ECHO) 'bt:' $(bt)
@$(ECHO) 'ct:' $(ct)
@$(ECHO) 'elt:' $(elt)
@$(ECHO) 'ft:' $(ft)
@$(ECHO) 'lt:' $(lt)
@$(ECHO) 'pst:' $(pst)
@$(ECHO) 'st:' $(st)
@$(ECHO) 'CFLAGS:' $(CFLAGS)
@$(ECHO) 'DEFS:' $(DEFS)
@$(ECHO) 'dist:' $(dist)
@$(ECHO) 'ai:' $(ai)
@$(ECHO) 'bi:' $(bi)
@$(ECHO) 'cati:' $(cati)
@$(ECHO) 'm1i:' $(m1i)
@$(ECHO) 'psi:' $(psi)
@$(ECHO) 'rci:' $(rci)
clean:
-$(RM) depend $(st)
clobber: clean
-$(RM) $(src) $(targets) FREEZE FREEZE.*
$(bt): %: %.b
$(RM) $@
$(ECHO) ' $(BDEFS)' > $@
$(CAT) $< >> $@
$(CHMOD) +x $@
$(ct): %: %.c
$(CC) -o $@ $(CFLAGS) $(DEFS) -DDEFPATH='"'$(RCID)'"' $(INCLUDES) \
$(LIBPATH) $*.c $(LIBES)
$(elt): %.elc: %.el
$(ELCMP) $<
$(lt): %-l: %.c $(LL)
$(LINT) $(LINTFLAGS) $(DEFS) -DDEFPATH='"'$(RCID)'"' $(INCLUDES) $< \
$(LL)
ifdef FMTMAN
$(ft): %.f: %
$(RM) $@
$(FMTMAN) $< > $@
endif
ifdef FMTLATEX
$(latext): %.texf: %.tex $(BIBS)
$(FMTLATEX) $* $@
$(spellt): %-s: %.tex
$(SPELL_LATEX) $<
endif
$(pst): %.ps: %.p4 ps-abbrev.m4
$(M4) $*.p4 | \
$(SED) -e 's;%.*;;' \
-e 's; ; ;g' \
-e 's;^ *;;' \
-e 's; *$$;;' \
-e 's; *; ;g' \
-e '/^$$/d' > $@
dkus.tt: 78freq2tt dkus.code dk.fr us.fr
$(RM) $@
./78freq2tt -d dkus.code dk.fr us.fr $@
seus.tt: 78freq2tt seus.code se.fr us.fr
$(RM) $@
./78freq2tt -d seus.code se.fr us.fr $@
shar: $(allsrc)
$(RM) test.abe
$(ABE) $(ABEFLAGS) $(TS) > test.abe
$(SHAR) README FREEZE MakeCommon Makefile uMakefile \
$(BS) $(BIBS) $(CODES) $(CS) $(ELS) $(FRS) $(HS) \
$(ms) $(M4S) $(P4S) $(RCS) $(LATEXS) $(TPSS) test.abe
$(st): %.s: %.c
$(CC) -S $(DEFS) -DDEFPATH='"'$(RCID)'"' $(INCLUDES) $<
ifdef WORK
dist: $(dist)
$(dist): $(DD)/%: %
$(DISTO) $< $(DD)
.DEFAULT:
$(UNCMPRS) $@
else # WORK
install: $(bi) $(ci) $(cati) $(codei) $(eli) $(mi) $(psi) \
$(rci) $(ti) $(tpsi) $(tti)
$(bi): $(BID)/%: %
$(INSTF) $< $(BID)
$(ci): $(CID)/%: %
$(INSTX) $< $(CID)
$(codei): $(CODEID)/%: %
$(INSTF) $< $(CODEID)
$(m1i): $(MID)/man1/%: %
$(INSTF) $< $(MID)/man1
ifdef CATMAN
$(cat1i): $(m1i)
$(CATMAN) -M $(MID) 1
endif
$(eli): $(ELID)/%: %
$(INSTF) $< $(ELID)
$(psi): $(PSID)/%: %
$(INSTF) $< $(PSID)
$(rci): $(RCID)/%: %
$(INSTF) $< $(RCID)
$(ti): $(TID)/%: %
$(INSTF) $< $(TID)
$(tpsi): $(TPSID)/%: %
$(INSTF) $< $(TPSID)
$(tti): $(TTID)/%: %
$(INSTF) $< $(TTID)
$(allsrc): %: $(DD)/%
$(DISTI) $@ $(DD)
.DEFAULT:
$(DISTI) $@ $(DD)
endif # WORK
8859-1.ps: 8859-1.m4
T-61.ps: T-61.m4
include depend