0 # st - simple terminal

1 # See LICENSE file for copyright and license details.

2 .POSIX:

3

4 include config.mk

5

6 SRC = st.c x.c

7 OBJ = $(SRC:.c=.o)

8

9 all: options st

10

11 options:

12 @echo st build options:

13 @echo "CFLAGS = $(STCFLAGS)"

14 @echo "LDFLAGS = $(STLDFLAGS)"

15 @echo "CC = $(CC)"

16

17 config.h:

18 cp config.def.h config.h

19

20 .c.o:

21 $(CC) $(STCFLAGS) -c {body}lt;

22

23 st.o: config.h st.h win.h

24 x.o: arg.h config.h st.h win.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

33

34 dist: clean

35 mkdir -p st-$(VERSION)

36 cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\

37 config.def.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 chmod 755 $(DESTDIR)$(PREFIX)/bin/st

46 mkdir -p $(DESTDIR)$(MANPREFIX)/man1

47 sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1

48 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1

49 tic -sx st.info

50 @echo Please see the README file regarding the terminfo entry of st.

51

52 uninstall:

53 rm -f $(DESTDIR)$(PREFIX)/bin/st

54 rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1

55

56 .PHONY: all options clean dist install uninstall

57