-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.11 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.11 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# Copyright (c) 2000,2003 by Solar Designer
# Copyright (c) 2006,2010 by Dmitry V. Levin
# See LICENSE
#
CC = gcc
LD = $(CC)
RM = rm -f
MKDIR = mkdir -p
INSTALL = install -c
CFLAGS = -Wall -O2 -fPIC
LDFLAGS = -s --shared -Wl,--version-script,$(MAP)
LDLIBS = -lpam
# This requires GNU make
ifeq ($(shell uname -s),SunOS)
# We support Sun's older /usr/ucb/install, but not the newer /usr/sbin/install
override INSTALL = /usr/ucb/install -c
override LDFLAGS = -G
endif
TITLE = pam_mktemp
PAM_SO_SUFFIX =
LIBSHARED = $(TITLE).so$(PAM_SO_SUFFIX)
SHLIBMODE = 755
SECUREDIR = /lib/security
DESTDIR =
OBJS = pam_mktemp.o
MAP = pam_mktemp.map
ifeq ($(USE_SELINUX),1)
override CFLAGS += -DUSE_SELINUX=1
override LDLIBS += -lselinux
endif
ifeq ($(USE_APPEND_FL),1)
override CFLAGS += -DUSE_APPEND_FL=1
endif
all: $(LIBSHARED)
pam_mktemp.so: $(OBJS) $(MAP)
$(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o pam_mktemp.so
.c.o:
$(CC) $(CFLAGS) -c $*.c
install:
$(MKDIR) $(DESTDIR)$(SECUREDIR)
$(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(DESTDIR)$(SECUREDIR)
remove:
$(RM) $(DESTDIR)$(SECUREDIR)/$(TITLE).so
clean:
$(RM) $(LIBSHARED) *.o