diff options
| -rw-r--r-- | LICENSE | 22 | ||||
| -rw-r--r-- | Makefile | 60 | ||||
| -rw-r--r-- | config.mk | 33 | ||||
| -rw-r--r-- | st.c | 11 | ||||
| -rw-r--r-- | std.c | 4 |
5 files changed, 130 insertions, 0 deletions
| @@ -0,0 +1,22 @@ | |||
| 1 | MIT/X Consortium License | ||
| 2 | |||
| 3 | © 2007-2008 Anselm R Garbe <garbeam at gmail dot com> | ||
| 4 | © 2007-2008 Matthias Christian Ott <ott at enolink dot de> | ||
| 5 | |||
| 6 | Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | copy of this software and associated documentation files (the "Software"), | ||
| 8 | to deal in the Software without restriction, including without limitation | ||
| 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 10 | and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | Software is furnished to do so, subject to the following conditions: | ||
| 12 | |||
| 13 | The above copyright notice and this permission notice shall be included in | ||
| 14 | all copies or substantial portions of the Software. | ||
| 15 | |||
| 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | DEALINGS IN THE SOFTWARE. | ||
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c4d0b1a --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | # st - simple terminal | ||
| 2 | # See LICENSE file for copyright and license details. | ||
| 3 | |||
| 4 | include config.mk | ||
| 5 | |||
| 6 | SRC = st | ||
| 7 | OBJ = ${SRC:.c=.o} | ||
| 8 | |||
| 9 | all: options st | ||
| 10 | |||
| 11 | options: | ||
| 12 | @echo st build options: | ||
| 13 | @echo "CFLAGS = ${CFLAGS}" | ||
| 14 | @echo "LDFLAGS = ${LDFLAGS}" | ||
| 15 | @echo "CC = ${CC}" | ||
| 16 | |||
| 17 | .c.o: | ||
| 18 | @echo CC $< | ||
| 19 | @${CC} -c ${CFLAGS} $< | ||
| 20 | |||
| 21 | ${OBJ}: config.h config.mk | ||
| 22 | |||
| 23 | config.h: | ||
| 24 | @echo creating $@ from config.def.h | ||
| 25 | @cp config.def.h $@ | ||
| 26 | |||
| 27 | st: ${OBJ} | ||
| 28 | @echo CC -o $@ | ||
| 29 | @${CC} -o $@ ${OBJ} ${LDFLAGS} | ||
| 30 | |||
| 31 | clean: | ||
| 32 | @echo cleaning | ||
| 33 | @rm -f st ${OBJ} st-${VERSION}.tar.gz | ||
| 34 | |||
| 35 | dist: clean | ||
| 36 | @echo creating dist tarball | ||
| 37 | @mkdir -p st-${VERSION} | ||
| 38 | @cp -R LICENSE Makefile README config.def.h config.mk \ | ||
| 39 | st.1 ${SRC} st-${VERSION} | ||
| 40 | @tar -cf st-${VERSION}.tar st-${VERSION} | ||
| 41 | @gzip st-${VERSION}.tar | ||
| 42 | @rm -rf st-${VERSION} | ||
| 43 | |||
| 44 | install: all | ||
| 45 | @echo installing executable file to ${DESTDIR}${PREFIX}/bin | ||
| 46 | @mkdir -p ${DESTDIR}${PREFIX}/bin | ||
| 47 | @cp -f st ${DESTDIR}${PREFIX}/bin | ||
| 48 | @chmod 755 ${DESTDIR}${PREFIX}/bin/st | ||
| 49 | @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 | ||
| 50 | @mkdir -p ${DESTDIR}${MANPREFIX}/man1 | ||
| 51 | @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1 | ||
| 52 | @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1 | ||
| 53 | |||
| 54 | uninstall: | ||
| 55 | @echo removing executable file from ${DESTDIR}${PREFIX}/bin | ||
| 56 | @rm -f ${DESTDIR}${PREFIX}/bin/st | ||
| 57 | @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 | ||
| 58 | @rm -f ${DESTDIR}${MANPREFIX}/man1/st.1 | ||
| 59 | |||
| 60 | .PHONY: all options clean dist install uninstall | ||
diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..5983bcb --- /dev/null +++ b/config.mk | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # st version | ||
| 2 | VERSION = 0.0 | ||
| 3 | |||
| 4 | # Customize below to fit your system | ||
| 5 | |||
| 6 | # paths | ||
| 7 | PREFIX = /usr/local | ||
| 8 | MANPREFIX = ${PREFIX}/share/man | ||
| 9 | |||
| 10 | X11INC = /usr/X11R6/include | ||
| 11 | X11LIB = /usr/X11R6/lib | ||
| 12 | |||
| 13 | # Xinerama, comment if you don't want it | ||
| 14 | XINERAMALIBS = -L${X11LIB} -lXinerama | ||
| 15 | XINERAMAFLAGS = -DXINERAMA | ||
| 16 | |||
| 17 | # includes and libs | ||
| 18 | INCS = -I. -I/usr/include -I${X11INC} | ||
| 19 | LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS} | ||
| 20 | |||
| 21 | # flags | ||
| 22 | CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} | ||
| 23 | CFLAGS = -Os ${INCS} ${CPPFLAGS} | ||
| 24 | LDFLAGS = -s ${LIBS} | ||
| 25 | #CFLAGS = -g -std=c99 -pedantic -Wall -O2 ${INCS} ${CPPFLAGS} | ||
| 26 | #LDFLAGS = -g ${LIBS} | ||
| 27 | |||
| 28 | # Solaris | ||
| 29 | #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" | ||
| 30 | #LDFLAGS = ${LIBS} | ||
| 31 | |||
| 32 | # compiler and linker | ||
| 33 | CC = cc | ||
| @@ -0,0 +1,11 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | ||
| 2 | #include <stdio.h> | ||
| 3 | |||
| 4 | int | ||
| 5 | main(int argc, char *argv[]) { | ||
| 6 | if(argc == 2 && !strcmp("-v", argv[1])) | ||
| 7 | eprint("st-"VERSION", © 2007-2008 st engineers, see LICENSE for details\n"); | ||
| 8 | else if(argc != 1) | ||
| 9 | eprint("usage: st [-v]\n"); | ||
| 10 | return 0; | ||
| 11 | } | ||
| @@ -0,0 +1,4 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | ||
| 2 | |||
| 3 | /* TODO: add the necessary code into here, which is going to be fork()ed from | ||
| 4 | * st if this isn't an attach process */ | ||
