dmenu-custom/Makefile

65 lines
1.7 KiB
Makefile
Raw Normal View History

2024-05-21 01:08:40 +02:00
# dmenu - dynamic menu
# See LICENSE file for copyright and license details.
.PHONY: all clean dist install uninstall
include config.mk
SRC = drw.c dmenu.c stest.c util.c
OBJ = $(SRC:.c=.o)
all: dmenu stest
.c.o:
$(CC) -c $(CFLAGS) $<
config.h:
cp config.def.h $@
config.mk:
cp config/config.mk config.mk
${SRC}: buildroot
$(OBJ): arg.h config.h config.mk drw.h
stest: stest.o
$(CC) -o $@ stest.o $(LDFLAGS)
dmenu: dmenu.o drw.o util.o
$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
clean:
find . -maxdepth 1 -type f | grep -Pv "^\./\.|Makefile$$" | xargs -r rm
rm -r tmp patch 2>/dev/null || true
git -C dmenu-flexipatch reset --hard HEAD
git -C dmenu-flexipatch clean -ffdx
buildroot:
cp config/patches.h dmenu-flexipatch/patches.h
flexipatch-finalizer/flexipatch-finalizer.sh -r -d dmenu-flexipatch -o tmp
rm -r tmp/Makefile tmp/config.mk patch 2>/dev/null || true
mv tmp/* ./
rmdir tmp
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
$(DESTDIR)$(PREFIX)/bin/dmenu_path\
$(DESTDIR)$(PREFIX)/bin/dmenu_run\
$(DESTDIR)$(PREFIX)/bin/stest\
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
$(DESTDIR)$(MANPREFIX)/man1/stest.1