2022-08-12 21:41:04 +02:00
|
|
|
# st - simple terminal
|
|
|
|
# See LICENSE file for copyright and license details.
|
|
|
|
.POSIX:
|
|
|
|
|
2022-10-07 14:47:14 +02:00
|
|
|
include options.mk
|
2022-08-12 21:41:04 +02:00
|
|
|
|
2023-01-12 17:01:26 +01:00
|
|
|
SRC = st.c x.c sixel.c sixelhls.c ligatures.c bd.c
|
2022-08-12 21:41:04 +02:00
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
all: options st
|
|
|
|
|
|
|
|
options:
|
|
|
|
@echo st build options:
|
2022-11-15 18:34:32 +01:00
|
|
|
@echo "CFLAGS = $(CFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(LDFLAGS)"
|
2022-08-12 21:41:04 +02:00
|
|
|
@echo "CC = $(CC)"
|
|
|
|
|
|
|
|
.c.o:
|
2022-11-15 18:34:32 +01:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
2022-08-12 21:41:04 +02:00
|
|
|
|
2022-08-18 17:50:31 +02:00
|
|
|
st.o: options.h st.h win.h
|
2022-10-07 14:47:14 +02:00
|
|
|
x.o: arg.h options.h st.h win.h
|
2022-11-13 22:16:04 +01:00
|
|
|
boxdraw.o: options.h st.h bd.h
|
2023-01-12 17:01:26 +01:00
|
|
|
ligatures.o: st.h
|
2022-08-12 21:41:04 +02:00
|
|
|
|
2022-11-13 22:16:04 +01:00
|
|
|
$(OBJ): options.mk
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
st: $(OBJ)
|
2022-11-15 18:34:32 +01:00
|
|
|
$(CC) -o $@ $(OBJ) $(LDFLAGS)
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
clean:
|
2022-11-13 22:16:04 +01:00
|
|
|
rm -f st $(OBJ) st-$(VERSION).tar.gz
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
dist: clean
|
2022-11-27 11:37:34 +01:00
|
|
|
mkdir -p st-spde-$(VERSION)
|
2022-11-13 22:16:04 +01:00
|
|
|
cp -R LICENSE Makefile *.mk \
|
2022-11-18 19:39:34 +01:00
|
|
|
*.h *.info *.c *.desktop *.png docs/ scripts/ \
|
2022-11-27 11:37:34 +01:00
|
|
|
st-spde-$(VERSION)
|
|
|
|
tar -cf - st-spde-$(VERSION) | gzip > st-spde-$(VERSION).tar.gz
|
|
|
|
rm -rf st-spde-$(VERSION)
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
install: st
|
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp -f st $(DESTDIR)$(PREFIX)/bin
|
2022-11-13 22:16:04 +01:00
|
|
|
cp -f scripts/* $(DESTDIR)$(PREFIX)/bin
|
|
|
|
chmod +x $(DESTDIR)$(PREFIX)/bin/st*
|
2022-08-12 21:41:04 +02:00
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
|
2022-11-13 22:16:04 +01:00
|
|
|
mkdir -p $(DESTDIR)$(APPPREFIX)
|
|
|
|
cp -f st.desktop $(DESTDIR)$(APPPREFIX)
|
2023-02-23 16:21:28 +01:00
|
|
|
[ -f $(ICONNAME) ] && cp -f $(ICONNAME) $(DESTDIR)$(ICONPREFIX)/$(ICONNAME) || :
|
2022-10-07 14:47:14 +02:00
|
|
|
rm -f *.o st
|
2022-11-13 22:16:04 +01:00
|
|
|
tic -sx st.info
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
2022-11-13 22:16:04 +01:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/st.desktop
|
2023-02-23 16:21:28 +01:00
|
|
|
rm -f $(DESTDIR)$(ICONPREFIX)/$(ICONNAME)
|
2022-08-19 14:50:06 +02:00
|
|
|
|
2022-11-13 22:16:04 +01:00
|
|
|
.PHONY: all options clean dist install uninstall
|