dmenu

[fork] X11 menuing
git clone https://hhvn.uk/dmenu
git clone git://hhvn.uk/dmenu
Log | Files | Refs | README | LICENSE

Makefile (1717B)


      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 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 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
     55 
     56 uninstall:
     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
     63 
     64 .PHONY: all options clean dist install uninstall