dmenu/Makefile

65 lines
1.7 KiB
Makefile
Raw Permalink Normal View History

2018-04-07 21:51:10 +00:00
# dmenu - dynamic menu
# See LICENSE file for copyright and license details.
include config.mk
SRC = drw.c dmenu.c stest.c util.c
2019-02-08 21:25:44 +00:00
OBJ = $(SRC:.c=.o)
2018-04-07 21:51:10 +00:00
all: options dmenu stest
options:
@echo dmenu build options:
2019-02-08 21:25:44 +00:00
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "CC = $(CC)"
2018-04-07 21:51:10 +00:00
.c.o:
2019-02-08 21:25:44 +00:00
$(CC) -c $(CFLAGS) $<
2018-04-07 21:51:10 +00:00
config.h:
2019-02-08 21:25:44 +00:00
cp config.def.h $@
2018-04-07 21:51:10 +00:00
2019-02-08 21:25:44 +00:00
$(OBJ): arg.h config.h config.mk drw.h
2018-04-07 21:51:10 +00:00
dmenu: dmenu.o drw.o util.o
2019-02-08 21:25:44 +00:00
$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
2018-04-07 21:51:10 +00:00
stest: stest.o
2019-02-08 21:25:44 +00:00
$(CC) -o $@ stest.o $(LDFLAGS)
2018-04-07 21:51:10 +00:00
clean:
2020-03-13 14:46:05 +00:00
rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz *.rej *.orig
2018-04-07 21:51:10 +00:00
dist: clean
2019-02-08 21:25:44 +00:00
mkdir -p dmenu-$(VERSION)
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
dmenu-$(VERSION)
tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
gzip dmenu-$(VERSION).tar
rm -rf dmenu-$(VERSION)
2018-04-07 21:51:10 +00:00
install: all
2019-02-08 21:25:44 +00:00
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
2018-04-07 21:51:10 +00:00
uninstall:
2019-02-08 21:25:44 +00:00
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
2018-04-07 21:51:10 +00:00
.PHONY: all options clean dist install uninstall