forked from CyberDem0n/pam-oauth2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
28 lines (22 loc) · 750 Bytes
/
Makefile
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
CFLAGS=-Wall -fPIC -std=c99 -pedantic
LIBDIR=/lib
ifeq ($(shell if uname -o | grep -q "GNU/Linux" ; then echo true; else echo false; fi),true)
ifeq ($(shell if [ -e /etc/debian_version ] ; then echo true; else echo false; fi),true)
DEB_HOST_MULTIARCH ?= $(shell dpkg -L libc6 | sed -nr 's|^/etc/ld\.so\.conf\.d/(.*)\.conf$$|\1|p')
ifneq ($(DEB_HOST_MULTIARCH),)
LIBDIR=/lib/$(DEB_HOST_MULTIARCH)
endif
else ifeq ($(shell uname -m),x86_64) # redhat?
LIBDIR=/lib64
endif
endif
PAM_DIR=$(LIBDIR)/security
all: pam_oauth2.so
pam_oauth2.so: pam_oauth2.o
$(CC) -shared $^ -lcurl -o $@
install: pam_oauth2.so
install -d $(DESTDIR)$(PAM_DIR)
install -m 644 $< $(DESTDIR)$(PAM_DIR)
clean:
$(MAKE) -C jsmn clean
rm -f *.o *.so