Make clean before building with tcc
build: Posixfy the Makefile
Simplify install/uninstall
build: Remove unneeded dependency
Make will search in the catalogue of rules for a way to
update the target, and in case of finding the dependency
it will apply the rule without a need of specifying that
dependency.
build: Move getconf.sh to scripts
The scripts directory is meant to contain all the scripts needed
in the build.
build: Simplify dist target
We can get rid of the SRC variable if we use shell wildcards.
build: Use ARFLAGS when creating libraries
ARFLAGS has the expected value for the toolchain used.
build: Remove LIBUTIL and LIBUTF
They were just hidding the actual names of te libraries and as
they were added to OBJ they were listed twice in the clean
command.
build: Remove LIBUTFSRC and LIBUTILSRC
These variables were used only to generate the variables
LIBUTFOBJ and LIBUTILOBJ.
sbase-box: Simplify Makefile rule
The Makefile rule was too complex and these cases is better to just
move it to a script where will be eassier to use sed properly
and not looping over all the files 4 times.
build: Remove .gitignore rule
It is not needed because it is just easier to maintain
the gitignore file.
ed: Deal signals in a reliable way
The signal handlers were calling longjmp() but as the code was calling
non signal safe functions the behaviour was very unpredictable generating
segmentation faults and dead lock. This commit changes the signal handlers
to only set a variable that is checked in safe places where long loops
happen.
Ensure commands are followed by a blank
POSIX.1-2017 demands in Shell & Utilities under 'Commands in ed':
The e, E, f, r, and w commands shall take an optional file parameter,
separated from the command letter by one or more <blank> characters.
Ensure at least one <blank> character (as defined for the POSIX locale)
is present or error out.
Signed-off-by: Rene Kita <mail@rkta.de>
ed: Open output file for writing
Fopen() and Popen() were open as read streams, but we were writing
in both cases. In the same way, the FILE pointer returned by popen()
was close with fclose() that can lead to file descriptor leaks and
zombie processes.