~armaan/opendoas

ref: 1200408d46bfd352b568cbb7c6c9cbf7e8584de3 opendoas/bsd.prog.mk -rw-r--r-- 1.0 KiB
1200408d — Duncaen Add doas style prompt for pam authentication 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 2015 Nathan Holstein

default: ${PROG}

CFLAGS  += -I${CURDIR}/libopenbsd ${COPTS} -MD -MP

include config.mk

OPENBSD := $(addprefix libopenbsd/,${OPENBSD})
OBJS    := ${SRCS:.y=.c}
OBJS    := ${OBJS:.c=.o}

libopenbsd.a: ${OPENBSD}
	${AR} -r $@ $?

${PROG}: ${OBJS} libopenbsd.a
	${CC} ${CFLAGS} ${LDFLAGS} $^ -o $@

install: ${PROG} ${PAM_DOAS} ${MAN}
	mkdir -p -m 0755 ${DESTDIR}${BINDIR}
	mkdir -p -m 0755 ${DESTDIR}${PAMDIR}
	mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man1
	mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man5
	cp -f ${PROG} ${DESTDIR}${BINDIR}
	chown ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/${PROG}
	chmod ${BINMODE} ${DESTDIR}${BINDIR}/${PROG}
	cp ${PAM_DOAS} ${DESTDIR}${PAMDIR}/doas
	chmod 0644 ${DESTDIR}${PAMDIR}/doas
	cp -f doas.1 ${DESTDIR}${MANDIR}/man1
	cp -f doas.conf.5 ${DESTDIR}${MANDIR}/man5

clean:
	rm -f version.h
	rm -f libopenbsd.a
	rm -f ${OPENBSD}
	rm -f ${OPENBSD:.o=.d}
	rm -f ${OBJS}
	rm -f ${OBJS:.o=.d}
	rm -f ${PROG}

-include ${OBJS:.o=.d} ${OPENBSD:.o=.d}

.PHONY: default clean install