2 # See LICENSE file for copyright and license details.
6 SRC = drw.c dmenu.c stest.c util.c
9 all: options dmenu stest
12 @echo dmenu build options:
13 @echo "CFLAGS = $(CFLAGS)"
14 @echo "LDFLAGS = $(LDFLAGS)"
23 $(OBJ): arg.h config.h config.mk drw.h
25 dmenu: dmenu.o drw.o util.o
26 $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
29 $(CC) -o $@ stest.o $(LDFLAGS)
32 rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
35 mkdir -p dmenu-$(VERSION)
36 cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
37 drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\
39 tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
40 gzip dmenu-$(VERSION).tar
41 rm -rf dmenu-$(VERSION)
44 mkdir -p $(DESTDIR)$(PREFIX)/bin
45 cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin
46 chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
47 chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path
48 chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
49 chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
50 mkdir -p $(DESTDIR)$(MANPREFIX)/man1
51 sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
52 sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
53 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
54 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1
57 rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
58 $(DESTDIR)$(PREFIX)/bin/dmenu_path\
59 $(DESTDIR)$(PREFIX)/bin/dmenu_run\
60 $(DESTDIR)$(PREFIX)/bin/stest\
61 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
62 $(DESTDIR)$(MANPREFIX)/man1/stest.1
64 .PHONY: all options clean dist install uninstall