summaryrefslogtreecommitdiff
path: root/security/PAM/patches/patch-ag
blob: a6c80f3703bebf9d41945aca3ebb46d1c10c6b8a (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
$NetBSD: patch-ag,v 1.4 2004/11/16 07:46:57 jlam Exp $

--- modules/pammodutil/Makefile.orig	2001-12-09 17:15:12.000000000 -0500
+++ modules/pammodutil/Makefile
@@ -25,10 +25,15 @@ LIBSTATIC = $(LIBNAME).a
 
 SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS) $(STATICOBJ))
 
+# libtool library name
+LIBLIBTOOL = $(LIBNAME).la
+
+LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
+
 # ---------------------------------------------
 ## rules
 
-all: dirs $(LIBSTATIC) ../../Make.Rules
+all: dirs $(LIBLIBTOOL) ../../Make.Rules
 
 dirs:
 	$(MKDIR) static
@@ -36,10 +41,19 @@ dirs:
 static/%.o : %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
+%.lo: %.c
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
+
 $(LIBSTATIC): $(SLIBOBJECTS)
 	ar cr $@ $(SLIBOBJECTS)
 	$(RANLIB) $@
 
+# This is a libtool convenience library that may be linked into shared
+# libraries and modules.
+#
+$(LIBLIBTOOL): $(LALIBOBJECTS)
+	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@
+
 install:
 	@echo "at this time, we're not installing $(LIBSTATIC)"
 
@@ -47,7 +61,8 @@ remove:
 	@echo "at this time, there is nothing to remove"
 
 clean:
-	rm -f a.out core *~ static/*.o
-	rm -f *.a *.o
+	rm -f a.out core *~ static/*.o .libs/*
+	rm -f *.a *.la *.la *.o
 	if [ -d dynamic ]; then rmdir dynamic ; fi
 	if [ -d static ]; then rmdir static ; fi
+	if [ -d libs ]; then rmdir .libs; fi