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