--- makefile.orig 2003-11-27 22:18:21.000000000 -0200 +++ makefile 2003-11-27 22:20:33.000000000 -0200 @@ -23,6 +23,13 @@ # carry out all the steps, in exactly the order given. Believe me, it # # will be much faster than doing it any other way. # # # +# If you're using a modern make program, you don't need to actually edit the # +# makefile to set the macros; instead, you can pass them in the command line # +# - for example, you can run "make lout BASEDIR=/home/jeff/lout". Editing # +# the makefile is actually easier - but the command-line alternative makes # +# it easier to automate the building process (for example, for package # +# maintainers). The recommended make program is GNU make. # +# # # (1) Set exactly one of the following macros defined below to 1 and the # # others all to 0, to indicate the operating system under which the # # Lout binary is to run. At present OSUNIX and OSDOS work but OSMAC # @@ -98,6 +105,10 @@ # MANDIR Directory where the lout and prg2lout online manual entries # # (in nroff -man) go. This directory is assumed to exist. # # # +# Alternatively, you may just set the macro BASEDIR. The default # +# setting of the macros above is based on $(BASEDIR) - for example, # +# BINDIR is set to $(BASEDIR)/bin. # +# # # (7) Set the following two macros defined below to appropriate values. # # I strongly recommend CHARIN=1 and CHAROUT=0 for all sites (English # # and non-English language). This way we get a truly international # @@ -281,10 +292,15 @@ # DEBUGGING = 1 # TRACING = -g -BINDIR = /home/jeff/bin -LIBDIR = /home/jeff/lout.lib -DOCDIR = /home/jeff/lout.doc -MANDIR = /home/jeff/lout.man +BASEDIR = /usr/local +BINDIR = $(BASEDIR)/bin +LIBDIR = $(BASEDIR)/share/lout +DOCDIR = $(BASEDIR)/share/doc/lout +MANDIR = $(BASEDIR)/share/man/man1 +#BINDIR = /home/jeff/bin +#LIBDIR = /home/jeff/lout.lib +#DOCDIR = /home/jeff/lout.doc +#MANDIR = /home/jeff/lout.man LIBFONT = font LIBMAPS = maps @@ -355,45 +371,41 @@ $(CC) $(COPTS) -o prg2lout prg2lout.c chmod a+x prg2lout -install: lout prg2lout +installbin: lout prg2lout @echo "" @echo "(a) Installing lout and prg2lout binaries into BINDIR $(BINDIR)" + mkdir -m 755 -p $(BINDIR) cp lout $(BINDIR)/lout chmod 755 $(BINDIR)/lout cp prg2lout $(BINDIR)/prg2lout chmod 755 $(BINDIR)/prg2lout + +installlib: lout @echo "" @echo "(b) Installing library files into LIBDIR $(LIBDIR)" - mkdir $(LIBDIR) - chmod 755 $(LIBDIR) - @echo "" - mkdir $(LIBDIR)/$(LIBINCL) - chmod 755 $(LIBDIR)/$(LIBINCL) + mkdir -m 755 -p $(LIBDIR)/$(LIBINCL) cp include/* $(LIBDIR)/$(LIBINCL) chmod 644 $(LIBDIR)/$(LIBINCL)/* @echo "" - mkdir $(LIBDIR)/$(LIBDATA) - chmod 755 $(LIBDIR)/$(LIBDATA) + mkdir -m 755 -p $(LIBDIR)/$(LIBDATA) cp data/* $(LIBDIR)/$(LIBDATA) chmod 644 $(LIBDIR)/$(LIBDATA)/* @echo "" - mkdir $(LIBDIR)/$(LIBHYPH) - chmod 755 $(LIBDIR)/$(LIBHYPH) + mkdir -m 755 -p $(LIBDIR)/$(LIBHYPH) cp hyph/* $(LIBDIR)/$(LIBHYPH) chmod 644 $(LIBDIR)/$(LIBHYPH)/* @echo "" - mkdir $(LIBDIR)/$(LIBFONT) - chmod 755 $(LIBDIR)/$(LIBFONT) + mkdir -m 755 -p $(LIBDIR)/$(LIBFONT) cp font/* $(LIBDIR)/$(LIBFONT) chmod 644 $(LIBDIR)/$(LIBFONT)/* @echo "" - mkdir $(LIBDIR)/$(LIBMAPS) - chmod 755 $(LIBDIR)/$(LIBMAPS) + mkdir -m 755 -p $(LIBDIR)/$(LIBMAPS) cp maps/* $(LIBDIR)/$(LIBMAPS) chmod 644 $(LIBDIR)/$(LIBMAPS)/* + +init: installbin installlib @echo "" - mkdir $(LIBDIR)/$(LIBLOCA) - chmod 755 $(LIBDIR)/$(LIBLOCA) + mkdir -m 755 -p $(LIBDIR)/$(LIBLOCA) @echo "" @echo "(c) Initializing run (should be silent, no errors expected)" $(BINDIR)/lout -x -s $(LIBDIR)/$(LIBINCL)/init @@ -402,8 +414,11 @@ chmod 644 $(LIBDIR)/$(LIBDATA)/* chmod 644 $(LIBDIR)/$(LIBHYPH)/* +install: init + installman: @echo "" + mkdir -m 755 -p $(MANDIR) @echo "Installing manual entries into MANDIR $(MANDIR)" sed -e "s@@$(BINDIR)@" -e "s@@$(LIBDIR)@" \ -e "s@@$(DOCDIR)@" -e "s@@$(MANDIR)@" \ @@ -415,18 +430,15 @@ installdoc: @echo "" @echo "Creating DOCDIR $(DOCDIR) and copying documentation into it" - $(RCOPY) doc $(DOCDIR) - chmod 755 $(DOCDIR) - chmod 755 $(DOCDIR)/* - chmod 644 $(DOCDIR)/*/* + mkdir -p $(DOCDIR) + $(RCOPY) doc/* $(DOCDIR) + chmod -R 755 $(DOCDIR) + find $(DOCDIR) -type f -exec chmod 644 '{}' ';' installfr: @echo "" @echo "Putting French error messages into $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)" - mkdir $(LIBDIR)/$(LIBLOCA)/$(LOC_FR) - chmod 755 $(LIBDIR)/$(LIBLOCA)/$(LOC_FR) - mkdir $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES - chmod 755 $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES + mkdir -m 755 -p $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES cp locale/msgs.fr $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES/msgs.$(LOC_FR) gencat $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES/errors.$(LOC_FR) \ $(LIBDIR)/$(LIBLOCA)/$(LOC_FR)/LC_MESSAGES/msgs.$(LOC_FR) @@ -435,10 +447,7 @@ installde: @echo "" @echo "Putting German error messages into $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)" - mkdir $(LIBDIR)/$(LIBLOCA)/$(LOC_DE) - chmod 755 $(LIBDIR)/$(LIBLOCA)/$(LOC_DE) - mkdir $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES - chmod 755 $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES + mkdir -m 755 -p $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES cp locale/msgs.de $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES/msgs.$(LOC_DE) gencat $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES/errors.$(LOC_DE) \ $(LIBDIR)/$(LIBLOCA)/$(LOC_DE)/LC_MESSAGES/msgs.$(LOC_DE)