pinentry-dmenu

a pinentry program based on dmenu
git clone anongit@rnpnr.xyz:pinentry-dmenu.git
Log | Files | Refs | Feed | README | LICENSE

Makefile (1703B)


      1 # pinentry-dmenu - dmenu-like stupid pin entry
      2 # See LICENSE file for copyright and license details.
      3 .POSIX:
      4 
      5 include config.mk
      6 
      7 SRC = pinentry-dmenu.c drw.c util.c
      8 OBJ = $(SRC:.c=.o)
      9 PIN_SRC = \
     10 	pinentry/argparse.c\
     11 	pinentry/password-cache.c\
     12 	pinentry/pinentry.c\
     13 	pinentry/secmem.c\
     14 	pinentry/util.c
     15 PIN_OBJ = $(PIN_SRC:.c=.o)
     16 PIN_DEP = \
     17 	pinentry/argparse.h\
     18 	pinentry/password-cache.h\
     19 	pinentry/pinentry.h\
     20 	pinentry/memory.h\
     21 	pinentry/util.h
     22 
     23 all: options pinentry-dmenu
     24 
     25 options:
     26 	@echo pinentry-dmenu build options:
     27 	@echo "CFLAGS   = $(CFLAGS)"
     28 	@echo "LDFLAGS  = $(LDFLAGS)"
     29 	@echo "CC       = $(CC)"
     30 
     31 .c.o:
     32 	$(CC) -c $(CFLAGS) $(INCS) $(CPPFLAGS) -o $@ -c $<
     33 
     34 config.h:
     35 	cp config.def.h $@
     36 
     37 $(OBJ): config.h config.mk drw.h
     38 
     39 $(PIN_OBJ): $(PIN_DEP)
     40 
     41 pinentry-dmenu: $(OBJ) $(PIN_OBJ)
     42 	$(CC) -o $@ $(OBJ) $(PIN_OBJ) $(LDFLAGS) $(LIBS)
     43 
     44 clean:
     45 	rm -f pinentry-dmenu $(OBJ) $(PIN_OBJ)
     46 
     47 dist: clean
     48 	mkdir -p pinentry-dmenu-$(VERSION)
     49 	cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1 \
     50 		drw.h util.h $(SRC) \
     51 		pinentry-dmenu-$(VERSION)
     52 	tar -cf pinentry-dmenu-$(VERSION).tar pinentry-dmenu-$(VERSION)
     53 	gzip pinentry-dmenu-$(VERSION).tar
     54 	rm -rf pinentry-dmenu-$(VERSION)
     55 
     56 install: all
     57 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     58 	cp -f pinentry-dmenu $(DESTDIR)$(PREFIX)/bin
     59 	chmod 755 $(DESTDIR)$(PREFIX)/bin/pinentry-dmenu
     60 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     61 	sed "s/VERSION/$(VERSION)/g" < pinentry-dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
     62 	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
     63 
     64 uninstall:
     65 	rm -f $(DESTDIR)$(PREFIX)/bin/pinentry-dmenu
     66 	rm -f $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
     67 
     68 .PHONY: all options clean dist install pinentry uninstall