diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..02045f0 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,62 @@ | |||
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 boxdraw.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: config.h st.h win.h | ||
22 | x.o: arg.h config.h st.h win.h hb.h | ||
23 | hb.o: st.h | ||
24 | boxdraw.o: config.h st.h boxdraw_data.h | ||
25 | |||
26 | $(OBJ): config.h config.mk | ||
27 | |||
28 | st: $(OBJ) | ||
29 | $(CC) -o $@ $(OBJ) $(STLDFLAGS) | ||
30 | |||
31 | clean: | ||
32 | rm -f st $(OBJ) st-$(VERSION).tar.gz *.rej *.orig *.o | ||
33 | |||
34 | dist: clean | ||
35 | mkdir -p st-$(VERSION) | ||
36 | cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\ | ||
37 | config.h st.info st.1 arg.h st.h win.h $(SRC)\ | ||
38 | st-$(VERSION) | ||
39 | tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz | ||
40 | rm -rf st-$(VERSION) | ||
41 | |||
42 | install: st | ||
43 | mkdir -p $(DESTDIR)$(PREFIX)/bin | ||
44 | cp -f st $(DESTDIR)$(PREFIX)/bin | ||
45 | cp -f st-copyout $(DESTDIR)$(PREFIX)/bin | ||
46 | cp -f st-urlhandler $(DESTDIR)$(PREFIX)/bin | ||
47 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st | ||
48 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st-copyout | ||
49 | chmod 755 $(DESTDIR)$(PREFIX)/bin/st-urlhandler | ||
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 | tic -sx st.info | ||
54 | @echo Please see the README file regarding the terminfo entry of st. | ||
55 | |||
56 | uninstall: | ||
57 | rm -f $(DESTDIR)$(PREFIX)/bin/st | ||
58 | rm -f $(DESTDIR)$(PREFIX)/bin/st-copyout | ||
59 | rm -f $(DESTDIR)$(PREFIX)/bin/st-urlhandler | ||
60 | rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1 | ||
61 | |||
62 | .PHONY: all options clean dist install uninstall | ||