Makefile (1851B)
1 # dmenu - dynamic menu 2 # See LICENSE file for copyright and license details. 3 4 include config.mk 5 6 SRC = drw.c dmenu.c stest.c util.c 7 OBJ = $(SRC:.c=.o) 8 9 all: options dmenu stest 10 11 options: 12 @echo dmenu build options: 13 @echo "CFLAGS = $(CFLAGS)" 14 @echo "LDFLAGS = $(LDFLAGS)" 15 @echo "CC = $(CC)" 16 17 .c.o: 18 $(CC) -c $(CFLAGS) $< 19 20 config.h: 21 cp config.def.h $@ 22 23 $(OBJ): arg.h config.h config.mk drw.h 24 25 dmenu: dmenu.o drw.o util.o 26 $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS) 27 28 stest: stest.o 29 $(CC) -o $@ stest.o $(LDFLAGS) 30 31 clean: 32 rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz 33 34 dist: clean 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 dmenu_run_history stest.1 $(SRC)\ 38 dmenu-$(VERSION) 39 tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION) 40 gzip dmenu-$(VERSION).tar 41 rm -rf dmenu-$(VERSION) 42 43 install: all 44 mkdir -p $(DESTDIR)$(PREFIX)/bin 45 cp -f dmenu dmenu_path dmenu_run dmenu_run_history 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/dmenu_run_history 50 chmod 755 $(DESTDIR)$(PREFIX)/bin/stest 51 mkdir -p $(DESTDIR)$(MANPREFIX)/man1 52 sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1 53 sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1 54 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1 55 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1 56 57 uninstall: 58 rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\ 59 $(DESTDIR)$(PREFIX)/bin/dmenu_path\ 60 $(DESTDIR)$(PREFIX)/bin/dmenu_run\ 61 $(DESTDIR)$(PREFIX)/bin/dmenu_run_history\ 62 $(DESTDIR)$(PREFIX)/bin/stest\ 63 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\ 64 $(DESTDIR)$(MANPREFIX)/man1/stest.1 65 66 .PHONY: all options clean dist install uninstall