make st and std separate programmes
This commit is contained in:
parent
339e7f3571
commit
0c0ada8a7f
22
Makefile
22
Makefile
@ -6,13 +6,14 @@ include config.mk
|
|||||||
SRC = st.c std.c util.c pty.c
|
SRC = st.c std.c util.c pty.c
|
||||||
OBJ = ${SRC:.c=.o}
|
OBJ = ${SRC:.c=.o}
|
||||||
|
|
||||||
all: options st
|
all: options st std
|
||||||
|
|
||||||
options:
|
options:
|
||||||
@echo st build options:
|
@echo st build options:
|
||||||
@echo "CFLAGS = ${CFLAGS}"
|
@echo "CFLAGS = ${CFLAGS}"
|
||||||
@echo "LDFLAGS = ${LDFLAGS}"
|
@echo "LDFLAGS = ${LDFLAGS}"
|
||||||
@echo "CC = ${CC}"
|
@echo "X11LDFLAGS = ${X11LDFLAGS}"
|
||||||
|
@echo "CC = ${CC}"
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
@echo CC $<
|
@echo CC $<
|
||||||
@ -20,13 +21,17 @@ options:
|
|||||||
|
|
||||||
${OBJ}: config.mk
|
${OBJ}: config.mk
|
||||||
|
|
||||||
st: ${OBJ}
|
st: st.o util.o
|
||||||
@echo CC -o $@
|
@echo CC -o $@
|
||||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
@${CC} -o $@ $^ ${LDFLAGS} ${X11LDFLAGS}
|
||||||
|
|
||||||
|
std: std.o pty.o util.o
|
||||||
|
@echo CC -o $@
|
||||||
|
@${CC} -o $@ $^ ${LDFLAGS}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo cleaning
|
@echo cleaning
|
||||||
@rm -f st ${OBJ} st-${VERSION}.tar.gz
|
@rm -f st std ${OBJ} st-${VERSION}.tar.gz
|
||||||
|
|
||||||
dist: clean
|
dist: clean
|
||||||
@echo creating dist tarball
|
@echo creating dist tarball
|
||||||
@ -41,11 +46,14 @@ install: all
|
|||||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||||
@cp -f st ${DESTDIR}${PREFIX}/bin
|
@cp -f st ${DESTDIR}${PREFIX}/bin
|
||||||
|
@cp -f std ${DESTDIR}${PREFIX}/bin
|
||||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/st
|
@chmod 755 ${DESTDIR}${PREFIX}/bin/st
|
||||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||||
@sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
|
@sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
|
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||||
|
@sed "s/VERSION/${VERSION}/g" < std.1 > ${DESTDIR}${MANPREFIX}/man1/std.1
|
||||||
|
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/std.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||||
|
@ -12,7 +12,8 @@ X11LIB = /usr/X11R6/lib
|
|||||||
|
|
||||||
# includes and libs
|
# includes and libs
|
||||||
INCS = -I. -I/usr/include -I${X11INC}
|
INCS = -I. -I/usr/include -I${X11INC}
|
||||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
|
LIBS = -L/usr/lib -lc
|
||||||
|
X11LIBS = -L${X11LIB} -lX11
|
||||||
|
|
||||||
# glibc
|
# glibc
|
||||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
|
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
|
||||||
@ -21,6 +22,7 @@ CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE
|
|||||||
#CPPFLAGS = -DVERSION=\"${VERSION}\"
|
#CPPFLAGS = -DVERSION=\"${VERSION}\"
|
||||||
CFLAGS = -Os ${INCS} ${CPPFLAGS}
|
CFLAGS = -Os ${INCS} ${CPPFLAGS}
|
||||||
LDFLAGS = -s ${LIBS}
|
LDFLAGS = -s ${LIBS}
|
||||||
|
X11LDFLAGS = ${X11LIBS}
|
||||||
#CFLAGS = -g -std=c99 -pedantic -Wall -O2 ${INCS} ${CPPFLAGS}
|
#CFLAGS = -g -std=c99 -pedantic -Wall -O2 ${INCS} ${CPPFLAGS}
|
||||||
#LDFLAGS = -g ${LIBS}
|
#LDFLAGS = -g ${LIBS}
|
||||||
|
|
||||||
|
2
st.c
2
st.c
@ -4,7 +4,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
Xmain(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
if(argc == 2 && !strcmp("-v", argv[1]))
|
if(argc == 2 && !strcmp("-v", argv[1]))
|
||||||
eprint("st-"VERSION", © 2007-2008 st engineers, see LICENSE for details\n");
|
eprint("st-"VERSION", © 2007-2008 st engineers, see LICENSE for details\n");
|
||||||
else if(argc != 1)
|
else if(argc != 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user