aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-05-20 10:03:59 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-05-20 10:03:59 +0100
commit1987ae4bacf58c588bbc967434be4e39125c37f9 (patch)
tree8e78431653d5a5186b259dc24c71c6d0c2a34c83
parent16f373e36cb2ef0512ac8a281cc18132b2b14b98 (diff)
downloadst-1987ae4bacf58c588bbc967434be4e39125c37f9.tar.gz
st-1987ae4bacf58c588bbc967434be4e39125c37f9.zip
added some new files for the initial rewrite of st from scratch
-rw-r--r--LICENSE22
-rw-r--r--Makefile60
-rw-r--r--config.mk33
-rw-r--r--st.c11
-rw-r--r--std.c4
5 files changed, 130 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5b1d694
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
1MIT/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
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the "Software"),
8to deal in the Software without restriction, including without limitation
9the rights to use, copy, modify, merge, publish, distribute, sublicense,
10and/or sell copies of the Software, and to permit persons to whom the
11Software is furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22DEALINGS 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
4include config.mk
5
6SRC = st
7OBJ = ${SRC:.c=.o}
8
9all: options st
10
11options:
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
23config.h:
24 @echo creating $@ from config.def.h
25 @cp config.def.h $@
26
27st: ${OBJ}
28 @echo CC -o $@
29 @${CC} -o $@ ${OBJ} ${LDFLAGS}
30
31clean:
32 @echo cleaning
33 @rm -f st ${OBJ} st-${VERSION}.tar.gz
34
35dist: 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
44install: 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
54uninstall:
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
2VERSION = 0.0
3
4# Customize below to fit your system
5
6# paths
7PREFIX = /usr/local
8MANPREFIX = ${PREFIX}/share/man
9
10X11INC = /usr/X11R6/include
11X11LIB = /usr/X11R6/lib
12
13# Xinerama, comment if you don't want it
14XINERAMALIBS = -L${X11LIB} -lXinerama
15XINERAMAFLAGS = -DXINERAMA
16
17# includes and libs
18INCS = -I. -I/usr/include -I${X11INC}
19LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
20
21# flags
22CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
23CFLAGS = -Os ${INCS} ${CPPFLAGS}
24LDFLAGS = -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
33CC = cc
diff --git a/st.c b/st.c
new file mode 100644
index 0000000..33f165c
--- /dev/null
+++ b/st.c
@@ -0,0 +1,11 @@
1/* See LICENSE file for copyright and license details. */
2#include <stdio.h>
3
4int
5main(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}
diff --git a/std.c b/std.c
new file mode 100644
index 0000000..af1f2bc
--- /dev/null
+++ b/std.c
@@ -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 */