JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
make st and std separate programmes
[st.git] / Makefile
1 # st - simple terminal
2 # See LICENSE file for copyright and license details.
3
4 include config.mk
5
6 SRC = st.c std.c util.c pty.c
7 OBJ = ${SRC:.c=.o}
8
9 all: options st std
10
11 options:
12         @echo st build options:
13         @echo "CFLAGS     = ${CFLAGS}"
14         @echo "LDFLAGS    = ${LDFLAGS}"
15         @echo "X11LDFLAGS = ${X11LDFLAGS}"
16         @echo "CC         = ${CC}"
17
18 .c.o:
19         @echo CC $<
20         @${CC} -c ${CFLAGS} $<
21
22 ${OBJ}: config.mk
23
24 st: st.o util.o
25         @echo CC -o $@
26         @${CC} -o $@ $^ ${LDFLAGS} ${X11LDFLAGS}
27
28 std: std.o pty.o util.o
29         @echo CC -o $@
30         @${CC} -o $@ $^ ${LDFLAGS}
31
32 clean:
33         @echo cleaning
34         @rm -f st std ${OBJ} st-${VERSION}.tar.gz
35
36 dist: clean
37         @echo creating dist tarball
38         @mkdir -p st-${VERSION}
39         @cp -R LICENSE Makefile README config.mk \
40                 st.1 ${SRC} st-${VERSION}
41         @tar -cf st-${VERSION}.tar st-${VERSION}
42         @gzip st-${VERSION}.tar
43         @rm -rf st-${VERSION}
44
45 install: all
46         @echo installing executable file to ${DESTDIR}${PREFIX}/bin
47         @mkdir -p ${DESTDIR}${PREFIX}/bin
48         @cp -f st ${DESTDIR}${PREFIX}/bin
49         @cp -f std ${DESTDIR}${PREFIX}/bin
50         @chmod 755 ${DESTDIR}${PREFIX}/bin/st
51         @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
52         @mkdir -p ${DESTDIR}${MANPREFIX}/man1
53         @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
54         @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
55         @sed "s/VERSION/${VERSION}/g" < std.1 > ${DESTDIR}${MANPREFIX}/man1/std.1
56         @chmod 644 ${DESTDIR}${MANPREFIX}/man1/std.1
57
58 uninstall:
59         @echo removing executable file from ${DESTDIR}${PREFIX}/bin
60         @rm -f ${DESTDIR}${PREFIX}/bin/st
61         @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
62         @rm -f ${DESTDIR}${MANPREFIX}/man1/st.1
63
64 .PHONY: all options clean dist install uninstall