2022-08-12 21:41:04 +02:00
# st - simple terminal
# See LICENSE file for copyright and license details.
.POSIX :
i n c l u d e c o n f i g . m k
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) "
.c.o :
$( CC) $( STCFLAGS) -c $<
2022-08-18 17:50:31 +02:00
st.o : options .h st .h win .h
x.o : arg .h options .h st .h win .h hb .h
2022-08-12 21:41:04 +02:00
hb.o : st .h
2022-08-18 17:50:31 +02:00
boxdraw.o : options .h st .h boxdraw_data .h
2022-08-12 21:41:04 +02:00
2022-08-18 17:50:31 +02:00
$(OBJ) : options .h config .mk
2022-08-12 21:41:04 +02:00
st : $( OBJ )
$( CC) -o $@ $( OBJ) $( STLDFLAGS)
clean :
2022-08-19 14:50:06 +02:00
rm -f st $( OBJ) st-spde-$( VERSION) .tar.gz
2022-08-12 21:41:04 +02:00
dist : clean
2022-08-18 17:50:31 +02:00
mkdir -p st-spde-$( VERSION)
cp -R LICENSE Makefile *.mk *.info *.h *.png *.desktop *.ttf $( SRC) \
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
@echo Please see the README file regarding the terminfo entry of st.
mkdir -p $( DESTDIR) $( ICONPREFIX)
2022-08-16 22:45:40 +02:00
[ -f $( ICONNAME) ] && cp -f $( ICONNAME) $( DESTDIR) $( ICONPREFIX) || :
2022-08-12 21:41:04 +02:00
mkdir -p $( DESTDIR) $( APPPREFIX)
cp -f st.desktop $( DESTDIR) $( APPPREFIX)
2022-08-18 17:50:31 +02:00
rm -f ./st
rm -f *.o
2022-08-12 21:41:04 +02:00
uninstall :
rm -f $( DESTDIR) $( PREFIX) /bin/st
rm -f $( DESTDIR) $( APPPREFIX) /st.desktop
rm -f $( DESTDIR) $( ICONPREFIX) /$( ICONNAME)
2022-08-19 14:50:06 +02:00
enablefont :
fontctrl install font.ttf
fontctrl enable font.ttf
help :
@echo "install: Install st"
@echo "uninstall: Uninstall st"
@echo " dist: Package st into st-spde- $( VERSION) .tar.gz (Used for Gentoo overlays and the AUR for example). "
@echo "clean: Remove .o files and st binary"
@echo "help: Display this list"
@echo "enablefont: Install and enable the included font.ttf. You must have fontctrl installed for this to be used. If you do not, install it here: https://codeberg.org/speedie/fontctrl"
.PHONY : all options clean dist install uninstall help enablefont