This commit is contained in:
DarthMooMancer
2025-08-10 00:29:55 -04:00
parent 4d0d0b5c0a
commit b9d3e91567
14 changed files with 65 additions and 204 deletions
+22 -7
View File
@@ -1,6 +1,25 @@
.POSIX:
include config.mk
PREFIX = /usr/local
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
PKG_CONFIG = pkg-config
# includes and libs
INCS = $(shell pkg-config --cflags x11 fontconfig freetype2) # -I$(X11INC)
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
# flags
STCPPFLAGS = -D_XOPEN_SOURCE=600
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS)
STLDFLAGS = $(LIBS) $(LDFLAGS)
# compiler and linker
CC = gcc
SRC = st.c x.c
OBJ = $(SRC:.c=.o)
@@ -13,7 +32,7 @@ all: st
st.o: config.h st.h win.h
x.o: arg.h config.h st.h win.h
$(OBJ): config.h config.mk
$(OBJ): config.h
st: $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
@@ -22,11 +41,7 @@ clean:
rm -f st $(OBJ)
install: st
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f st $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
install -Dm755 st $(DESTDIR)$(PREFIX)/bin/st
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st
.PHONY: all clean install uninstall