shithub: scc

Download patch

ref: c1f170493c680bc949c45797a13d09d7d0a08938
parent: 9df2bb4ed45bb22397cb50cde8fcfcb83c986a0f
author: Christoph Lohmann <[email protected]>
date: Tue Aug 29 10:42:15 EDT 2017

Add a manpage for scc.

--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,9 @@
 	cp -r rootdir/* $(DESTDIR)$(PREFIX)/
 	cd $(DESTDIR)$(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc*
 	cd $(DESTDIR)$(PREFIX)/bin && chmod 755 scpp scc && strip scc
+	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+	sed "s/VERSION/$(VERSION)/g" < doc/scc.1 > $(DESTDIR)$(MANPREFIX)/man1/scc.1
+	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/scc.1
 
 uninstall:
 	rm -rf $(DESTDIR)$(PREFIX)/libexec/scc/
@@ -44,3 +47,4 @@
 	rm -rf $(DESTDIR)$(PREFIX)/lib/scc/
 	rm -f $(DESTDIR)$(PREFIX)/bin/scc
 	rm -f $(DESTDIR)$(PREFIX)/bin/scpp
+	rm -f $(DESTDIR)$(MANPREFIX)/man1/scc.1
--- /dev/null
+++ b/doc/scc.1
@@ -1,0 +1,157 @@
+.TH SCC 1 scc\-VERSION
+.SH NAME
+scc \- simple C compiler with magic
+.SH SYNOPSIS
+.B scc
+.RB [ \-cdgkqQsw ]
+.RB [ \-M | \-E | \-S ]
+.RB [ \-D
+.IR def[=val] ] ...
+.RB [ \-I
+.IR dir ] ...
+.RB [ \-L
+.IR dir ] ...
+.RB [ \-U
+.IR def ] ...
+.RB [ \-l
+.IR lib ]
+.RB [ \-m
+.IR arch ]
+.RB [ \-o
+.IR outfile ]
+.RB [ \-O
+.IR level ]
+.RB [ \-t
+.IR sys ]
+.RB [ \-W
+.IR warn ]
+.RB sourcefile ...
+.SH DESCRIPTION
+.B scc
+is a simple C compiler which takes several
+.I sourcefiles
+and compiles them to an executable. The default output file is
+.B a.out,
+which can be changed by defining some
+.I outfile.
+.SH OPTIONS
+.TP
+.B \-c
+Do not run the linker.
+.TP
+.B \-d
+Do output internal tool messages.
+.TP
+.BI \-D " define[=value]"
+Specify a
+.I define
+for the preprocessor.
+.TP
+.B \-E
+Stop after the preprocessing stage, do not run the compiler and output the then
+resulting source.
+.TP
+.B \-g
+Do generate debug information.
+.TP
+.BI \-I " directory"
+Define a include
+.I directory
+to get header files from. This directory is searched for before standard
+include directories.
+.TP
+.B \-k
+Do keep temporary objects.
+.TP
+.BI \-l " library"
+Link against this 
+.I library.
+.TP
+.BI \-L " directory"
+Define a library
+.I directory
+to resolve dependencies from. This directory is used before the standard
+paths.
+.TP
+.BI \-m " architecture"
+Define the
+.I architecture
+to compile for (i.e. amd64, i386 ...).
+.TP
+.B \-M
+Output a rule for 
+.B make
+describing the dependencies of the main source file.
+.TP
+.BI \-o " outfile"
+Define the name of the
+.I outfile.
+.TP
+.BI \-O " level"
+Define the optimisation
+.I level
+to compile with. (This is a stub for compatibility reasons.)
+.TP
+.B \-q
+Do not use
+.I QBE.
+.TP
+.B \-Q
+Do use the
+.I QBE.
+.TP
+.B \-s
+Strip all symbol tables and relocation information from the resulting executable.
+.TP
+.B \-S
+Stop after the compilation stage, do not assemble and output the assembler
+source.
+.TP
+.BI \-t " system"
+Define the
+.I system
+to compile for (i.e. linux, openbsd ...).
+.TP
+.BI \-U " define"
+Undefine a previously defined
+.I define
+by the -D parameter.
+.TP
+.B \-w
+Do show warning messages.
+.TP
+.BI \-W " warnings"
+This option only activates -w and is otherwise ignored for compatibility
+reasons.
+.SH ENVIRONMENT VARIABLES
+Certain environment variables control the behaviour of scc.
+.TP
+.B ARCH
+defines the
+.I architecture
+to compile for (i.e. amd64, i386 ...).
+.TP
+.B SYS
+defines the
+.I system
+to compile for (i.e. linux, openbsd ...).
+.TP
+.B ABI
+defines the
+.I application binary interface
+to compile for (i.e. sysv ...).
+.TP
+.B FORMAT
+defines the format of the output executable.
+.TP
+.B SCCPREFIX
+defines the path prefix scc will search the scc suite in.
+.SH AUTHORS
+See the LICENSE file for the authors.
+.SH LICENSE
+See the LICENSE file for the terms of redistribution.
+.SH SEE ALSO
+.BR scpp (1),
+.BR make (1)
+.SH BUGS
+See the TODO file in the distribution.