summaryrefslogtreecommitdiff
path: root/Makefile.Debian
blob: 597c53a1e608d2cc01c6b6bf784b6f9a0808f8f5 (plain)
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
# Modified Makefile to allow for building of the standalone module

TITLE=pam_pwdfile

CC = gcc
LD = gcc
CFLAGS = -fPIC -c -g -Wall -Wformat-security -fvisibility=hidden
LDFLAGS = -Wl,-x --shared
LDLIBS = -lcrypt -lpam -lpam_misc
LIBSRC = $(TITLE).c
LIBOBJ = $(TITLE).o md5_good.o md5_broken.o md5_crypt_good.o md5_crypt_broken.o bigcrypt.o
LIBSHARED = $(TITLE).so
PAM_LIB_DIR = $(DESTDIR)/lib/security
INSTALL = /usr/bin/install

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
   CFLAGS += -O0
else
   CFLAGS += -O2
endif


all: $(LIBSHARED)

md5_good.o: md5.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -DHIGHFIRST -D'MD5Name(x)=Good##x' \
		$(TARGET_ARCH) $< -o $@

md5_broken.o: md5.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
		$(TARGET_ARCH) $< -o $@

md5_crypt_good.o: md5_crypt.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Good##x' \
		$(TARGET_ARCH) $< -o $@

md5_crypt_broken.o: md5_crypt.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
		$(TARGET_ARCH) $< -o $@

$(LIBSHARED): $(LIBOBJ)
	$(LD) $(LDFLAGS) -o $@ $(LIBOBJ) $(LDLIBS)

install: $(LIBSHARED)
	$(INSTALL) -m 0755 -d $(PAM_LIB_DIR)
	$(INSTALL) -m 0644 pam_pwdfile.so $(PAM_LIB_DIR)

clean:
	rm -f $(LIBOBJS) $(LIBSHARED) core *~

extraclean: clean
	rm -f *.a *.o *.so *.bak 

.c.o:	
	$(CC) $(CFLAGS) $< -o $@