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
|
|
|
|
|
|
|
SRC = st.c x.c boxdraw.c hb.c
|
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
all: options st
|
|
|
|
|
|
|
|
options:
|
|
|
|
@echo st build options:
|
|
|
|
@echo "CFLAGS = $(STCFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(STLDFLAGS)"
|
|
|
|
@echo "CC = $(CC)"
|
2022-10-07 14:47:14 +02:00
|
|
|
@echo "======================"
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(STCFLAGS) -c $<
|
|
|
|
|
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-08-18 17:50:31 +02:00
|
|
|
boxdraw.o: options.h st.h boxdraw_data.h
|
2022-10-07 14:47:14 +02:00
|
|
|
hb.o: st.h
|
2022-08-12 21:41:04 +02:00
|
|
|
|
2022-10-07 14:47:14 +02:00
|
|
|
$(OBJ): options.h options.mk
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
st: $(OBJ)
|
|
|
|
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
|
|
|
|
|
|
|
|
clean:
|
2022-10-09 17:42:04 +02:00
|
|
|
rm -f st $(OBJ) st-spde-$(VERSION).tar.gz
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
dist: clean
|
2022-10-09 17:42:04 +02:00
|
|
|
mkdir -p st-spde-$(VERSION)
|
2022-10-07 14:47:14 +02:00
|
|
|
cp -R LICENSE Makefile README *.mk\
|
|
|
|
*.h *.info *.c *.png *.desktop *.ttf docs/ scripts/ \
|
2022-10-09 17:42:04 +02: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
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
|
|
|
|
tic -sx st.info
|
2022-10-07 14:47:14 +02:00
|
|
|
rm -f *.o st
|
2022-09-02 17:04:36 +02:00
|
|
|
cp -f scripts/st_urllist $(DESTDIR)$(PREFIX)/bin
|
2022-09-02 15:11:13 +02:00
|
|
|
cp -f scripts/st_buffer $(DESTDIR)$(PREFIX)/bin
|
|
|
|
cp -f scripts/st_xurls $(DESTDIR)$(PREFIX)/bin
|
2022-10-07 14:47:14 +02:00
|
|
|
cp -f scripts/st_help $(DESTDIR)$(PREFIX)/bin
|
2022-09-02 17:04:36 +02:00
|
|
|
chmod +x $(DESTDIR)$(PREFIX)/bin/st_urllist
|
2022-09-02 15:11:13 +02:00
|
|
|
chmod +x $(DESTDIR)$(PREFIX)/bin/st_buffer
|
|
|
|
chmod +x $(DESTDIR)$(PREFIX)/bin/st_xurls
|
2022-10-07 14:47:14 +02:00
|
|
|
chmod +x $(DESTDIR)$(PREFIX)/bin/st_help
|
|
|
|
mkdir -p $(DESTDIR)$(ICONPREFIX)
|
|
|
|
[ -f $(ICONNAME) ] && cp -f $(ICONNAME) $(DESTDIR)$(ICONPREFIX) || :
|
2022-08-12 21:41:04 +02:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
2022-10-07 14:47:14 +02:00
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
2022-08-12 21:41:04 +02:00
|
|
|
rm -f $(DESTDIR)$(ICONPREFIX)/$(ICONNAME)
|
|
|
|
|
2022-08-19 14:50:06 +02:00
|
|
|
help:
|
2022-10-07 14:47:14 +02:00
|
|
|
@echo "st Makefile help"
|
|
|
|
@echo
|
|
|
|
@echo "install Install st."
|
|
|
|
@echo "uninstall Uninstall st."
|
|
|
|
@echo "clean Remove st tarball and binary"
|
|
|
|
@echo "options Print compilation options."
|
|
|
|
@echo "enablefont Install the font.ttf using fontctrl."
|
|
|
|
@echo "dist Create a tarball for use with package managers or for releases."
|
|
|
|
@echo "help List of all options."
|
|
|
|
|
|
|
|
enablefont:
|
|
|
|
fontctrl install font.ttf --global
|
|
|
|
fontctrl enable font.ttf --global
|
2022-08-19 14:50:06 +02:00
|
|
|
|
2022-10-07 14:47:14 +02:00
|
|
|
.PHONY: all options clean dist install uninstall enablefont help
|