# HG changeset patch # User Paul Boddie # Date 1487890966 -3600 # Node ID 96e7d83d8d83a856df6de13ccce68b4a1157885f # Parent 97ec110d65cf9df12f1d05a125f5067276bab26f Changed the working data directory to use a suffixed form of the output executable name. Updated the test script to recognise the suffixed working data directory. Added examples and files sections to the manual page. diff -r 97ec110d65cf -r 96e7d83d8d83 docs/lplc.1 --- a/docs/lplc.1 Thu Feb 23 16:39:02 2017 +0100 +++ b/docs/lplc.1 Fri Feb 24 00:02:46 2017 +0100 @@ -82,7 +82,35 @@ .TP .BR \-V ", " \-\-version Show version information for this tool -.SH ENVIRONMENT VARIABLES +.SH EXAMPLES +Compile the main program in +.BR hello.py , +including all source files that the program requires: +.IP +lplc -o hello hello.py +.PP +This produces an output executable called +.B hello +in the current directory, assuming that +.B hello.py +can be compiled without errors. +.SH FILES +.B lplc +produces an output executable file called +.B _main +unless the +.B \-o +option is given with a different name. Working data is stored in a directory +whose name is derived from the output executable name. Therefore, the working +data directory will be called +.B _main.lplc +unless otherwise specified. For example, an output executable called +.B hello +will have a working data directory called +.BR hello.lplc . +This is intended to allow work to proceed efficiently on multiple programs in +the same directory, although it can also create lots of unwanted directories. +.SH ENVIRONMENT .TP ARCH Indicates a prefix to be used with tool names when building an executable. This diff -r 97ec110d65cf -r 96e7d83d8d83 lplc --- a/lplc Thu Feb 23 16:39:02 2017 +0100 +++ b/lplc Fri Feb 24 00:02:46 2017 +0100 @@ -23,7 +23,7 @@ from errors import * from os import environ, listdir, remove, rename -from os.path import abspath, exists, isdir, isfile, join, split +from os.path import abspath, exists, extsep, isdir, isfile, join, split from pyparser import error from subprocess import Popen, PIPE from time import time @@ -245,7 +245,7 @@ # Define the output data directories. - datadir = "_lplc" + datadir = "%s%s%s" % (output, extsep, "lplc") # _main.lplc by default cache_dir = join(datadir, "_cache") deduced_dir = join(datadir, "_deduced") output_dir = join(datadir, "_output") diff -r 97ec110d65cf -r 96e7d83d8d83 test_all.sh --- a/test_all.sh Thu Feb 23 16:39:02 2017 +0100 +++ b/test_all.sh Fri Feb 24 00:02:46 2017 +0100 @@ -3,7 +3,7 @@ # This tool runs the toolchain for each of the tests, optionally building and # running the test programs. # -# Copyright (C) 2016 Paul Boddie +# Copyright (C) 2016, 2017 Paul Boddie # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -22,7 +22,7 @@ OPTION=$1 LPLC="./lplc" -DATADIR="_lplc" +DATADIR="_main.lplc" TESTINPUT="_results/testinput.txt" # Expect failure from the "bad" tests.