st/Makefile

60 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:
@echo "CFLAGS = $(STCFLAGS)"
@echo "LDFLAGS = $(STLDFLAGS)"
@echo "CC = $(CC)"
.c.o:
$(CC) $(STCFLAGS) -c $<
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)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
clean:
rm -f st $(OBJ) st-$(VERSION).tar.gz
2022-08-12 21:41:04 +02:00
dist: clean
mkdir -p st-$(VERSION)
cp -R LICENSE Makefile *.mk \
*.h *.info *.h *.c *.desktop *.png docs/ scripts/ \
st-$(VERSION)
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
rm -rf st-$(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)$(MANPREFIX)/man1
mkdir -p $(DESTDIR)$(APPPREFIX)
cp -f st.desktop $(DESTDIR)$(APPPREFIX)
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
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
2022-08-19 14:50:06 +02:00
.PHONY: all options clean dist install uninstall