]> git.armaanb.net Git - st.git/blob - Makefile
Switch to zenburn theme
[st.git] / Makefile
1 # st - simple terminal
2 # See LICENSE file for copyright and license details.
3 .POSIX:
4
5 include config.mk
6
7 SRC = st.c x.c hb.c
8 OBJ = $(SRC:.c=.o)
9
10 all: options st
11
12 options:
13         @echo st build options:
14         @echo "CFLAGS  = $(STCFLAGS)"
15         @echo "LDFLAGS = $(STLDFLAGS)"
16         @echo "CC      = $(CC)"
17
18 .c.o:
19         $(CC) $(STCFLAGS) -c $<
20
21 st.o: st.h win.h
22 x.o: arg.h st.h win.h hb.h
23 hb.o: st.h
24
25 $(OBJ): config.mk
26
27 st: $(OBJ)
28         $(CC) -o $@ $(OBJ) $(STLDFLAGS)
29
30 clean:
31         rm -f st $(OBJ) st-$(VERSION).tar.gz
32
33 dist: clean
34         mkdir -p st-$(VERSION)
35         cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
36                 st.info st.1 arg.h st.h win.h $(SRC)\
37                 st-$(VERSION)
38         tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
39         rm -rf st-$(VERSION)
40
41 install: st
42         mkdir -p $(DESTDIR)$(PREFIX)/bin
43         cp -f st $(DESTDIR)$(PREFIX)/bin
44         chmod 755 $(DESTDIR)$(PREFIX)/bin/st
45         mkdir -p $(DESTDIR)$(MANPREFIX)/man1
46         sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
47         chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
48         tic -sx st.info
49         @echo Please see the README file regarding the terminfo entry of st.
50
51 uninstall:
52         rm -f $(DESTDIR)$(PREFIX)/bin/st
53         rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
54
55 .PHONY: all options clean dist install uninstall