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)"
19 @
$(CC
) -c
$(CFLAGS
) $<
22 @echo creating
$@ from config.def.h
25 $(OBJ
): arg.h config.h config.mk drw.h
27 dmenu
: dmenu.o drw.o util.o
29 @
$(CC
) -o
$@ dmenu.o drw.o util.o
$(LDFLAGS
)
33 @
$(CC
) -o
$@ stest.o
$(LDFLAGS
)
37 @
rm -f dmenu stest
$(OBJ
) dmenu-
$(VERSION
).
tar.gz
40 @echo creating
dist tarball
41 @mkdir
-p dmenu-
$(VERSION
)
42 @cp LICENSE Makefile README arg.h config.def.h config.mk dmenu
.1 \
43 drw.h util.h dmenu_path dmenu_run stest
.1 $(SRC
) \
45 @
tar -cf dmenu-
$(VERSION
).
tar dmenu-
$(VERSION
)
46 @gzip dmenu-
$(VERSION
).
tar
47 @
rm -rf dmenu-
$(VERSION
)
50 @echo installing executables to
$(DESTDIR
)$(PREFIX
)/bin
51 @mkdir
-p
$(DESTDIR
)$(PREFIX
)/bin
52 @cp
-f dmenu dmenu_path dmenu_run stest
$(DESTDIR
)$(PREFIX
)/bin
53 @chmod
755 $(DESTDIR
)$(PREFIX
)/bin
/dmenu
54 @chmod
755 $(DESTDIR
)$(PREFIX
)/bin
/dmenu_path
55 @chmod
755 $(DESTDIR
)$(PREFIX
)/bin
/dmenu_run
56 @chmod
755 $(DESTDIR
)$(PREFIX
)/bin
/stest
57 @echo installing manual pages to
$(DESTDIR
)$(MANPREFIX
)/man1
58 @mkdir
-p
$(DESTDIR
)$(MANPREFIX
)/man1
59 @sed
"s/VERSION/$(VERSION)/g" < dmenu
.1 > $(DESTDIR
)$(MANPREFIX
)/man1
/dmenu
.1
60 @sed
"s/VERSION/$(VERSION)/g" < stest
.1 > $(DESTDIR
)$(MANPREFIX
)/man1
/stest
.1
61 @chmod
644 $(DESTDIR
)$(MANPREFIX
)/man1
/dmenu
.1
62 @chmod
644 $(DESTDIR
)$(MANPREFIX
)/man1
/stest
.1
65 @echo removing executables from
$(DESTDIR
)$(PREFIX
)/bin
66 @
rm -f
$(DESTDIR
)$(PREFIX
)/bin
/dmenu
67 @
rm -f
$(DESTDIR
)$(PREFIX
)/bin
/dmenu_path
68 @
rm -f
$(DESTDIR
)$(PREFIX
)/bin
/dmenu_run
69 @
rm -f
$(DESTDIR
)$(PREFIX
)/bin
/stest
70 @echo removing manual page from
$(DESTDIR
)$(MANPREFIX
)/man1
71 @
rm -f
$(DESTDIR
)$(MANPREFIX
)/man1
/dmenu
.1
72 @
rm -f
$(DESTDIR
)$(MANPREFIX
)/man1
/stest
.1
74 .PHONY
: all options
clean dist install uninstall