[download]

local/src/dmenu/Makefile

   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 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  47 	sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1
  48 	sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1
  49 
  50 uninstall:
  51 	rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
  52 		$(DESTDIR)$(PREFIX)/bin/dmenu_path\
  53 		$(DESTDIR)$(PREFIX)/bin/dmenu_run\
  54 		$(DESTDIR)$(PREFIX)/bin/stest\
  55 		$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\
  56 		$(DESTDIR)$(MANPREFIX)/man1/stest.1
  57 
  58 .PHONY: all options clean dist install uninstall