This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
pinentry-dmenu-custom/Makefile

69 lines
1.7 KiB
Makefile
Raw Normal View History

2022-09-28 09:39:54 +02:00
# pinentry-dmenu - dmenu-like stupid pin entry
# See LICENSE file for copyright and license details.
2024-02-05 17:56:12 +01:00
.POSIX:
2022-09-28 09:39:54 +02:00
include config.mk
SRC = pinentry-dmenu.c drw.c util.c
2024-02-05 17:56:12 +01:00
OBJ = $(SRC:.c=.o)
PIN_SRC = \
pinentry/argparse.c\
pinentry/password-cache.c\
pinentry/pinentry.c\
pinentry/secmem.c\
pinentry/util.c
PIN_OBJ = $(PIN_SRC:.c=.o)
PIN_DEP = \
pinentry/argparse.h\
pinentry/password-cache.h\
pinentry/pinentry.h\
pinentry/memory.h\
pinentry/util.h
2022-09-28 09:39:54 +02:00
all: options pinentry-dmenu
options:
@echo pinentry-dmenu build options:
2024-02-05 17:56:12 +01:00
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "CC = $(CC)"
2022-09-28 09:39:54 +02:00
.c.o:
2024-02-05 17:56:12 +01:00
$(CC) -c $(CFLAGS) $(INCS) $(CPPFLAGS) -o $@ -c $<
2022-09-28 09:39:54 +02:00
config.h:
2024-02-05 17:56:12 +01:00
cp config.def.h $@
2022-09-28 09:39:54 +02:00
2024-02-05 17:56:12 +01:00
$(OBJ): config.h config.mk drw.h
2022-09-28 09:39:54 +02:00
2024-02-05 17:56:12 +01:00
$(PIN_OBJ): $(PIN_DEP)
2022-09-28 09:39:54 +02:00
2024-02-05 17:56:12 +01:00
pinentry-dmenu: $(OBJ) $(PIN_OBJ)
$(CC) -o $@ $(OBJ) $(PIN_OBJ) $(LDFLAGS) $(LIBS)
2022-09-28 09:39:54 +02:00
clean:
2024-02-05 17:56:12 +01:00
rm -f pinentry-dmenu $(OBJ) $(PIN_OBJ)
2022-09-28 09:39:54 +02:00
dist: clean
2024-02-05 17:56:12 +01:00
mkdir -p pinentry-dmenu-$(VERSION)
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1 \
drw.h util.h $(SRC) \
pinentry-dmenu-$(VERSION)
tar -cf pinentry-dmenu-$(VERSION).tar pinentry-dmenu-$(VERSION)
gzip pinentry-dmenu-$(VERSION).tar
rm -rf pinentry-dmenu-$(VERSION)
2022-09-28 09:39:54 +02:00
install: all
2024-02-05 17:56:12 +01:00
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f pinentry-dmenu $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/pinentry-dmenu
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < pinentry-dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
2022-09-28 09:39:54 +02:00
uninstall:
2024-02-05 17:56:12 +01:00
rm -f $(DESTDIR)$(PREFIX)/bin/pinentry-dmenu
rm -f $(DESTDIR)$(MANPREFIX)/man1/pinentry-dmenu.1
2022-09-28 09:39:54 +02:00
.PHONY: all options clean dist install pinentry uninstall