refactoring

This commit is contained in:
Luca Bilke 2024-05-19 00:08:34 +02:00
parent 351d62e8ba
commit 1b321026d1
No known key found for this signature in database
GPG Key ID: C9E851809C1A5BDE
2 changed files with 19 additions and 23 deletions

View File

@ -11,7 +11,25 @@ OBJ = $(SRC:.c=.o)
all: st terminfo
# TODO: Update command to update submodules
*.c: buildroot
*.h: buildroot
.c.o:
$(CC) $(STCFLAGS) -c $<
st.o: buildroot config.h st.h win.h
x.o: buildroot arg.h config.h st.h win.h $(LIGATURES_H)
config.mk:
cp config/config.mk config.mk
config.h:
cp config/config.h config.h
$(OBJ): config.h config.mk buildroot
st: buildroot $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
terminfo: buildroot
tic -sx -o terminfo st.info
clean:
find . -maxdepth 1 -type f | grep -Pv "^\./\.|Makefile$$" | xargs -r rm
@ -26,28 +44,6 @@ buildroot:
mv tmp/* ./
for patch in config/patches/*.diff; do patch <"$$patch"; done
config.mk:
cp config/config.mk ./config.mk
config.h:
cp config/config.h ./config.h
*.c: buildroot
*.h: buildroot
.c.o:
$(CC) $(STCFLAGS) -c $<
st.o: buildroot config.h st.h win.h
x.o: buildroot arg.h config.h st.h win.h $(LIGATURES_H)
$(OBJ): config.h config.mk buildroot
st: buildroot $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
terminfo: buildroot
tic -sx -o terminfo st.info
install: st terminfo
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f st $(DESTDIR)$(PREFIX)/bin