st/Makefile

59 lines
1.3 KiB
Makefile
Raw Normal View History

2022-08-12 21:41:04 +02:00
# st - simple terminal
# See LICENSE file for copyright and license details.
.POSIX:
include options.mk
2022-08-12 21:41:04 +02:00
SRC = st.c x.c sixel.c sixelhls.c hb.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
st.o: options.h st.h win.h
x.o: arg.h options.h st.h win.h
boxdraw.o: options.h st.h bd.h
hb.o: st.h
2022-08-12 21:41:04 +02: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:
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)
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
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
mkdir -p $(DESTDIR)$(APPPREFIX)
cp -f st.desktop $(DESTDIR)$(APPPREFIX)
2022-11-15 17:40:20 +01:00
[ -f $(ICONNAME) ] && cp -f $(ICONNAME) $(DESTDIR)$(ICONPREFIX) || :
rm -f *.o st
tic -sx st.info
2022-08-12 21:41:04 +02:00
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st
rm -f $(DESTDIR)$(PREFIX)/bin/st.desktop
2022-08-19 14:50:06 +02:00
.PHONY: all options clean dist install uninstall